Background Tiles

This section has all the functions related to using tiles.

Tiles are made from large background images that GameMaker: Studio splits into parts based on the parameters that you input. These parts are classed as individual tiles and can be used for many different things. Due to the fact that they are a purely graphic resource they are very fast to draw (they have far fewer internal variables associated with them, unlike instances) and large numbers can be used in a game to add details and life to a level, however you should still try and limit the number of different layers (depths) that are used at any one time and keep them to the minimum necessary.

Tile Layers

Tiles are drawn by depth, where lower depths appear on top of higher depths. Each depth is called a layer and there are a number of functions that can be used to get information about tile layers and to move them around:

  1. tile_layer_depth
  2. tile_layer_find
  3. tile_layer_hide
  4. tile_layer_show
  5. tile_layer_shift
  6. tile_layer_delete
  7. tile_layer_delete_at

Tile Information

The following functions can be used to get specific information about a single tile in the game (you can use the function tile_layer_find to get the index of a single tile to use in these functions):

  1. tile_get_background
  2. tile_get_alpha
  3. tile_get_visible
  4. tile_get_blend
  5. tile_get_depth
  6. tile_get_width
  7. tile_get_height
  8. tile_get_left
  9. tile_get_top
  10. tile_get_x
  11. tile_get_y
  12. tile_get_xscale
  13. tile_get_yscale
  14. tile_get_count
  15. tile_get_id
  16. tile_get_ids
  17. tile_get_ids_at_depth

Tile Manipulation

The following functions can be used to add and remove tiles at runtime, as well as to set individual tile properties:

  1. tile_exists
  2. tile_add
  3. tile_delete
  4. tile_set_background
  5. tile_set_visible
  6. tile_set_alpha
  7. tile_set_blend
  8. tile_set_depth
  9. tile_set_position
  10. tile_set_region
  11. tile_set_scale


Back: Backgrounds
© Copyright YoYo Games Ltd. 2018 All Rights Reserved