-
Notifications
You must be signed in to change notification settings - Fork 0
class_tilemap
####Inherits: Node2D ####Category: Core
Node for 2D Tile-Based games.
- void set_tileset ( TileSet tileset )
- TileSet get_tileset ( ) const
- void set_cell_size ( int size )
- int get_cell_size ( ) const
- void set_quadrant_size ( int size )
- int get_quadrant_size ( ) const
- void set_center_x ( bool enable )
- bool get_center_x ( ) const
- void set_center_y ( bool enable )
- bool get_center_y ( ) const
- void set_collision_layer_mask ( int mask )
- int get_collision_layer_mask ( ) const
- void set_cell ( int x, int y, int tile, bool flip_x=false, bool flip_y=false )
- int get_cell ( int x, int y ) const
- bool is_cell_x_flipped ( int x, int y ) const
- bool is_cell_y_flipped ( int x, int y ) const
- void clear ( )
- settings_changed ( )
- INVALID_CELL = -1 - Returned when a cell doesn't exist.
Node for 2D Tile-Based games. Tilemaps use a TileSet which contain a list of tiles (textures, their rect and a collision) and are used to create complex grid-based maps. To optimize drawing and culling (sort of like GridMap), you can specify a quadrant size, so chunks of the map will be batched together the time of drawing.
- void set_tileset ( TileSet tileset )
Set the current tileset.
- TileSet get_tileset ( ) const
Return the current tileset.
- void set_cell_size ( int size )
Set the cell size.
- int get_cell_size ( ) const
Return the cell size.
- void set_quadrant_size ( int size )
Set the quadrant size, this optimizes drawing by batching chunks of map at draw/cull time.
- int get_quadrant_size ( ) const
Return the quadrant size, this optimizes drawing by batching chunks of map at draw/cull time.
- void set_center_x ( bool enable )
Set tiles to be centered in x coordinate. (by default this is false and they are drawn from upper left cell corner).
- bool get_center_x ( ) const
Return true if tiles are to be centered in x coordinate (by default this is false and they are drawn from upper left cell corner).
- void set_center_y ( bool enable )
Set tiles to be centered in y coordinate. (by default this is false and they are drawn from upper left cell corner).
- bool get_center_y ( ) const
Return true if tiles are to be centered in y coordinate (by default this is false and they are drawn from upper left cell corner).
Set the contents of a cell. Cells can be optionally flipped in y or x.
Return the contents of a cell.
Return if a given cell is flipped in x axis.
Return if a given cell is flipped in y axis.
- void clear ( )
Clear all cells.