TileSet¶
Inherits: Resource < Reference < Object
Category: Core
Brief Description¶
Tile library for tilemaps.
Member Functions¶
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.
Tiles are referenced by a unique integer ID.
Member Function Description¶
- void clear ( )
Clear all tiles.
- void create_tile ( int id )
Create a new tile which will be referenced by the given ID.
Find the first tile matching the given name.
- int get_last_unused_tile_id ( ) const
Return the ID following the last currently used ID, useful when creating a new tile.
- Array get_tiles_ids ( ) const
Return an array of all currently used tile IDs.
- void remove_tile ( int id )
Remove the tile referenced by the given ID.
- void tile_add_shape ( int id, Shape2D shape, Transform2D shape_transform, bool one_way=null )
- OccluderPolygon2D tile_get_light_occluder ( int id ) const
Return the light occluder of the tile.
- ShaderMaterial tile_get_material ( int id ) const
Return the material of the tile.
Return the name of the tile.
Return the navigation polygon of the tile.
Return the offset of the tile’s navigation polygon.
Return the offset of the tile’s light occluder.
Return the tile sub-region in the texture.
- Transform2D tile_get_shape_transform ( int id, int shape_id ) const
Return the array of shapes of the tile.
Return the texture of the tile.
Return the texture offset of the tile.
- void tile_set_light_occluder ( int id, OccluderPolygon2D light_occluder )
Set a light occluder for the tile.
- void tile_set_material ( int id, ShaderMaterial material )
Set the material of the tile.
Set the name of the tile, for descriptive purposes.
Set a navigation polygon for the tile.
Set an offset for the tile’s navigation polygon.
Set an offset for the tile’s light occluder.
Set the tile sub-region in the texture. This is common in texture atlases.
- void tile_set_shape_transform ( int id, int shape_id, Transform2D shape_transform )
Set an array of shapes for the tile, enabling physics to collide with it.
Set the texture of the tile.
Set the texture offset of the tile.