manipulate tiles alpha

Mr Errorz

Member
I want my tiles to fade in/out under specific game conditions,
so, how can one control the alpha of all the tiles in a room [or of a certain depth]?
I mean, I know there's tile_set_alpha, but how can I use that function to effect all the tiles in the room?
or maybe there's another better function for that?
 

CoderJoe

Member
I believe there is a way get the tile with something like tile_get or tile_get_at. I would imagine you could loop through all the tiles using 2 for loops and set each one's alpha. I haven't used tiles a lot so I'm not much help. If you use a surface you can set the alpha of the surface.
 

johnwo

Member
Use something like:

Code:
var count = tile_get_count();
for (var i = 0; i < count; i++) {
    tile_set_alpha(tile_get_id(i),alpha);
}
Cheers!
 
Top