-
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_mode ( int mode )
- int get_mode ( ) const
- void set_half_offset ( int half_offset )
- int get_half_offset ( ) const
- void set_custom_transform ( Matrix32 custom_transform )
- Matrix32 get_custom_transform ( ) const
- void set_cell_size ( Vector2 size )
- Vector2 get_cell_size ( ) const
- void set_quadrant_size ( int size )
- int get_quadrant_size ( ) const
- void set_tile_origin ( int origin )
- int get_tile_origin ( ) 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_y_sort_mode ( bool enable )
- bool is_y_sort_mode_enabled ( ) const
- void set_collision_use_kinematic ( bool use_kinematic )
- bool get_collision_use_kinematic ( ) const
- void set_collision_layer ( int mask )
- int get_collision_layer ( ) const
- void set_collision_mask ( int mask )
- int get_collision_mask ( ) const
- void set_collision_friction ( float value )
- float get_collision_friction ( ) const
- void set_collision_bounce ( float value )
- float get_collision_bounce ( ) const
- void set_cell ( int x, int y, int tile, bool flip_x=false, bool flip_y=false, bool transpose=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 ( )
- Array get_used_cells ( ) const
- Vector2 map_to_world ( Vector2 mappos, bool ignore_half_ofs=false ) const
- Vector2 world_to_map ( Vector2 worldpos ) const
- settings_changed ( )
- INVALID_CELL = -1 - Returned when a cell doesn't exist.
- MODE_SQUARE = 0
- MODE_ISOMETRIC = 1
- MODE_CUSTOM = 2
- HALF_OFFSET_X = 0
- HALF_OFFSET_Y = 1
- HALF_OFFSET_DISABLED = 2
- TILE_ORIGIN_TOP_LEFT = 0
- TILE_ORIGIN_CENTER = 1
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 ( Vector2 size )
Set the cell size.
- Vector2 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).
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.