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...
TileSetAtlasSource¶
Inherits: TileSetSource < Resource < RefCounted < Object
Exposes a 2D atlas texture as a set of tiles for a TileSet resource.
Description¶
An atlas is a grid of tiles laid out on a texture. Each tile in the grid must be exposed using create_tile. Those tiles are then indexed using their coordinates in the grid.
Each tile can also have a size in the grid coordinates, making it more or less cells in the atlas.
Alternatives version of a tile can be created using create_alternative_tile, which are then indexed using an alternative ID. The main tile (the one in the grid), is accessed with an alternative ID equal to 0.
Each tile alternate has a set of properties that is defined by the source's TileSet layers. Those properties are stored in a TileData object that can be accessed and modified using get_tile_data.
As TileData properties are stored directly in the TileSetAtlasSource resource, their properties might also be set using TileSetAtlasSource.set("<coords_x>:<coords_y>/<alternative_id>/<tile_data_property>")
.
Properties¶
|
||
|
||
|
||
|
Methods¶
void |
|
create_alternative_tile ( Vector2i atlas_coords, int alternative_id_override=-1 ) |
|
void |
create_tile ( Vector2i atlas_coords, Vector2i size=Vector2i(1, 1) ) |
get_atlas_grid_size ( ) const |
|
get_next_alternative_tile_id ( Vector2i atlas_coords ) const |
|
get_runtime_texture ( ) const |
|
get_runtime_tile_texture_region ( Vector2i atlas_coords, int frame ) const |
|
get_tile_animation_columns ( Vector2i atlas_coords ) const |
|
get_tile_animation_frame_duration ( Vector2i atlas_coords, int frame_index ) const |
|
get_tile_animation_frames_count ( Vector2i atlas_coords ) const |
|
get_tile_animation_mode ( Vector2i atlas_coords ) const |
|
get_tile_animation_separation ( Vector2i atlas_coords ) |