forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
class_tileset
reduz edited this page Feb 23, 2014
·
15 revisions
Inherits: Resource\n\n
Tile library for tilemaps.
- 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_offset ( int id, Vector2 offset )
- Vector2 tile_get_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
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.
- void create_tile ( int id ) \ Create a new tile, the ID must be specified.
- void tile_set_name ( int id, String name ) \ Set the name of a tile, for decriptive purposes.
- String tile_get_name ( int id ) const \ Return the name of a tile, for decriptive purposes.
- void tile_set_texture ( int id, Texture texture ) \ Set the texture of the tile.
- Texture tile_get_texture ( int id ) const \ Return the texture of the tile.
- void tile_set_offset ( int id, Vector2 offset ) \ Set the offset to draw the tile.
- Vector2 tile_get_offset ( int id ) const \ Return the offset to draw the tile.
- void tile_set_region ( int id, Rect2 region ) \ Set the tile sub-region in the texture. This is common in texture atlases.
- Rect2 tile_get_region ( int id ) const \ Return the tile sub-region in the texture. This is common in texture atlases.
- void tile_set_shape ( int id, Shape2D shape ) \ Set a shape for the tile, enabling physics to collide it.
- Shape2D tile_get_shape ( int id ) const \ Return the shape of the tile.
- void remove_tile ( int id ) \ Remove a tile, by integer id.
- void clear ( ) \ Clear all tiles.
- int get_last_unused_tile_id ( ) const \ Find an empty id for creating a new tile.
- int find_tile_by_name ( String name ) const \ Find the first tile with the given name.