You actually have more control over tiles than you might think. You can add them when designing the room but you can also add them during the running of the game. You can change their position, and even scale them or make them partially transparent. A tile has the following properties:
The following functions exist that deal with tiles:
tile_add(background,left,top,width,height,x,y,depth) Adds a new tile to the room with the indicated values (see above for their meaning). The function returns the id of the tile that can be used later on.
tile_delete(id) Deletes the tile with the given id.
tile_exists(id) Returns whether a tile with the given id exists.
tile_get_x(id) Returns the x-position of the tile with the given id.
tile_get_y(id) Returns the y-position of the tile with the given id.
tile_get_left(id) Returns the left value of the tile with the given id.
tile_get_top(id) Returns the top value of the tile with the given id.
tile_get_width(id) Returns the width of the tile with the given id.
tile_get_height(id) Returns the height of the tile with the given id.
tile_get_depth(id) Returns the depth of the tile with the given id.
tile_get_visible(id) Returns whether the tile with the given id is visible.
tile_get_xscale(id) Returns the xscale of the tile with the given id.
tile_get_yscale(id) Returns the yscale of the tile with the given id.
tile_get_background(id) Returns the background of the tile with the given id.
tile_get_blend(id) Returns the blending color of the tile with the given id.
tile_get_alpha(id) Returns the alpha value of the tile with the given id.
tile_set_position(id,x,y) Sets the position of the tile with the given id.
tile_set_region(id,left,right,width,height) Sets the region of the tile with the given id in its background.
tile_set_background(id,background) Sets the background for the tile with the given id.
tile_set_visible(id,visible) Sets whether the tile with the given id is visible.
tile_set_depth(id,depth) Sets the depth of the tile with the given id.
tile_set_scale(id,xscale,yscale) Sets the scaling of the tile with the given id.
tile_set_blend(id,color) Sets the blending color of the tile with the given id. tile_set_alpha(id,alpha) Sets the alpha value of the tile with the given id.
The following functions deal with layers of tiles, that is, collections of tiles at the same depth.
tile_layer_hide(depth) Hides all tiles at the indicated depth layer.
tile_layer_show(depth) Shows all tiles at the indicated depth layer.
tile_layer_delete(depth) Deletes all tiles at the indicated depth layer.
tile_layer_shift(depth,x,y) Shifts all tiles at the indicated depth layer over the vector x,y. Can be used to create scrolling layers of tiles.
tile_layer_find(depth,x,y) Returns the id of the tile with the given depth at position (x,y). When no tile exists at the position -1 is returned. When multiple tiles with the given depth exist at the position the first one is returned.
tile_layer_delete_at(depth,x,y) Deletes the tile with the given depth at position (x,y). When multiple tiles with the given depth exist at the position they are all deleted.
tile_layer_depth(depth,newdepth) Changes the depth of all tiles at the indicated depth to the new depth. With this function you can move whole tile layers to a new depth.
Converted from CHM to HTML with chm2web Pro 2.85 (unicode) |