Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
TileSet¶
Inherits: Resource < RefCounted < Object
Tile library for tilemaps.
Description¶
A TileSet is a library of tiles for a TileMap. A TileSet handles a list of TileSetSource, each of them storing a set of tiles.
Tiles can either be from a TileSetAtlasSource, which renders tiles out of a texture with support for physics, navigation, etc., or from a TileSetScenesCollectionSource, which exposes scene-based tiles.
Tiles are referenced by using three IDs: their source ID, their atlas coordinates ID, and their alternative tile ID.
A TileSet can be configured so that its tiles expose more or fewer properties. To do so, the TileSet resources use property layers, which you can add or remove depending on your needs.
For example, adding a physics layer allows giving collision shapes to your tiles. Each layer has dedicated properties (physics layer and mask), so you may add several TileSet physics layers for each type of collision you need.
See the functions to add new layers for more information.
Tutorials¶
Properties¶
|
||
|
||
|
||
|
||
|
Methods¶
void |
add_custom_data_layer ( int to_position=-1 ) |
void |
add_navigation_layer ( int to_position=-1 ) |
void |
add_occlusion_layer ( int to_position=-1 ) |
add_pattern ( TileMapPattern pattern, int index=-1 ) |
|
void |
add_physics_layer ( int to_position=-1 ) |
add_source ( TileSetSource source, int atlas_source_id_override=-1 ) |
|
void |
add_terrain ( int terrain_set, int to_position=-1 ) |
void |
add_terrain_set ( int to_position=-1 ) |
void |
|
void |
|
get_alternative_level_tile_proxy ( int source_from, Vector2i coords_from, int alternative_from ) |
|
get_coords_level_tile_proxy ( int source_from, Vector2i coords_from ) |
|
get_custom_data_layer_by_name ( String layer_name ) const |
|
get_custom_data_layer_name ( int layer_index ) const |
|
get_custom_data_layer_type ( int layer_index ) const |
|
get_custom_data_layers_count ( ) const |
|
get_navigation_layer_layer_value ( int layer_index, int layer_number ) const |
|
get_navigation_layer_layers ( int layer_index ) const |
|
get_navigation_layers_count ( ) const |
|
get_next_source_id ( ) const |
|
get_occlusion_layer_light_mask ( int layer_index ) const |
|
get_occlusion_layer_sdf_collision ( int layer_index ) const |
|
get_occlusion_layers_count ( ) const |
|
get_pattern ( int index=-1 ) |
|
get_physics_layer_collision_layer ( int layer_index ) const |
|
get_physics_layer_collision_mask ( int layer_index ) const |
|
get_physics_layer_physics_material ( int layer_index ) const |
|
get_physics_layers_count ( ) const |
|
get_source ( int source_id ) const |
|
get_source_count ( ) const |
|
get_source_id ( int index ) const |
|
get_source_level_tile_proxy ( int source_from ) |
|
get_terrain_color ( int terrain_set, int terrain_index ) const |
|
get_terrain_name ( int terrain_set, int terrain_index ) const |
|
get_terrain_set_mode ( int terrain_set ) const |
|
get_terrain_sets_count ( ) const |
|
get_terrains_count ( int terrain_set ) const |
|
has_alternative_level_tile_proxy ( int source_from, Vector2i coords_from, int alternative_from ) |
|
has_coords_level_tile_proxy ( int source_from, Vector2i coords_from ) |
|
has_source ( int source_id ) const |
|
has_source_level_tile_proxy ( int source_from ) |
|
map_tile_proxy ( int source_from, Vector2i coords_from, int alternative_from ) const |
|
void |
move_custom_data_layer ( int layer_index, int to_position ) |
void |
move_navigation_layer ( int layer_index, int to_position ) |
void |
move_occlusion_layer ( int layer_index, int to_position ) |
void |
move_physics_layer ( int layer_index, int to_position ) |
void |
move_terrain ( int terrain_set, int terrain_index, int to_position ) |
void |
move_terrain_set ( int terrain_set, int to_position ) |
void |
remove_alternative_level_tile_proxy ( int source_from, Vector2i coords_from, int alternative_from ) |
void |
remove_coords_level_tile_proxy ( int source_from, Vector2i coords_from ) |
void |
remove_custom_data_layer ( int layer_index ) |
void |
remove_navigation_layer ( int layer_index ) |
void |
remove_occlusion_layer ( int layer_index ) |
void |
remove_pattern ( int index ) |
void |
remove_physics_layer ( int layer_index ) |
void |
remove_source ( int source_id ) |
void |
remove_source_level_tile_proxy ( int source_from ) |
void |
remove_terrain ( int terrain_set, int terrain_index ) |
void |
remove_terrain_set ( int terrain_set ) |
void |