class_tileset - vkbsb/godot GitHub Wiki
TileSet
####Inherits: Resource ####Category: Core
Brief Description
Tile library for tilemaps.
Member Functions
- void create_tile ( int id )
- void tile_set_name ( int id, String name )
- String tile_get_name ( int id ) const
- void tile_set_texture ( int id, Texture texture )
- Texture tile_get_texture ( int id ) const
- void tile_set_texture_offset ( int id, Vector2 texture_offset )
- Vector2 tile_get_texture_offset ( int id ) const
- void tile_set_shape_offset ( int id, Vector2 shape_offset )
- Vector2 tile_get_shape_offset ( int id ) const
- void tile_set_region ( int id, Rect2 region )
- Rect2 tile_get_region ( int id ) const
- void tile_set_shape ( int id, Shape2D shape )
- Shape2D tile_get_shape ( int id ) const
- void tile_set_shapes ( int id, Array shapes )
- Array tile_get_shapes ( int id ) const
- void remove_tile ( int id )
- void clear ( )
- int get_last_unused_tile_id ( ) const
- int find_tile_by_name ( String name ) const
- Array get_tiles_ids ( ) const
Description
A TileSet is a library of tiles for a TileMap. It contains a list of tiles, each consisting of a sprite and optional collision shapes.
Member Function Description
create_tile
- void create_tile ( int id )
Create a new tile, the ID must be specified.
tile_set_name
Set the name of a tile, for decriptive purposes.
tile_get_name
Return the name of a tile, for decriptive purposes.
tile_set_texture
Set the texture of the tile.
tile_get_texture
Return the texture of the tile.
tile_set_region
Set the tile sub-region in the texture. This is common in texture atlases.
tile_get_region
Return the tile sub-region in the texture. This is common in texture atlases.
tile_set_shape
Set a shape for the tile, enabling physics to collide it.
tile_get_shape
Return the shape of the tile.
remove_tile
- void remove_tile ( int id )
Remove a tile, by integer id.
clear
- void clear ( )
Clear all tiles.
get_last_unused_tile_id
- int get_last_unused_tile_id ( ) const
Find an empty id for creating a new tile.
find_tile_by_name
Find the first tile with the given name.