pandemonium_engine/modules/layered_tile_map/doc_classes/LayeredTileSetSource.xml

65 lines
3.1 KiB
XML
Raw Normal View History

2024-03-01 10:43:35 +01:00
<?xml version="1.0" encoding="UTF-8" ?>
2024-04-26 17:32:25 +02:00
<class name="LayeredTileSetSource" inherits="Resource" version="4.4">
2024-03-01 10:43:35 +01:00
<brief_description>
Exposes a set of tiles for a [LayeredTileSet] resource.
2024-03-01 10:43:35 +01:00
</brief_description>
<description>
Exposes a set of tiles for a [LayeredTileSet] resource.
Tiles in a source are indexed with two IDs, coordinates ID (of type Vector2i) and an alternative ID (of type int), named according to their use in the [LayeredTileSetAtlasSource] class.
Depending on the LayeredTileSet source type, those IDs might have restrictions on their values, this is why the base [LayeredTileSetSource] class only exposes getters for them.
You can iterate over all tiles exposed by a LayeredTileSetSource by first iterating over coordinates IDs using [method get_tiles_count] and [method get_tile_id], then over alternative IDs using [method get_alternative_tiles_count] and [method get_alternative_tile_id].
[b]Warning:[/b] [LayeredTileSetSource] can only be added to one LayeredTileSet at the same time. Calling [method LayeredTileSet.add_source] on a second [LayeredTileSet] will remove the source from the first one.
2024-03-01 10:43:35 +01:00
</description>
<tutorials>
</tutorials>
<methods>
<method name="get_alternative_tile_id" qualifiers="const">
<return type="int" />
<argument index="0" name="atlas_coords" type="Vector2i" />
<argument index="1" name="index" type="int" />
2024-03-01 10:43:35 +01:00
<description>
Returns the alternative ID for the tile with coordinates ID [param atlas_coords] at index [param index].
</description>
</method>
<method name="get_alternative_tiles_count" qualifiers="const">
<return type="int" />
<argument index="0" name="atlas_coords" type="Vector2i" />
2024-03-01 10:43:35 +01:00
<description>
Returns the number of alternatives tiles for the coordinates ID [param atlas_coords].
For [LayeredTileSetAtlasSource], this always return at least 1, as the base tile with ID 0 is always part of the alternatives list.
2024-03-01 10:43:35 +01:00
Returns -1 if there is not tile at the given coords.
</description>
</method>
<method name="get_tile_id" qualifiers="const">
<return type="Vector2i" />
<argument index="0" name="index" type="int" />
2024-03-01 10:43:35 +01:00
<description>
Returns the tile coordinates ID of the tile with index [param index].
</description>
</method>
<method name="get_tiles_count" qualifiers="const">
<return type="int" />
<description>
Returns how many tiles this atlas source defines (not including alternative tiles).
</description>
</method>
<method name="has_alternative_tile" qualifiers="const">
<return type="bool" />
<argument index="0" name="atlas_coords" type="Vector2i" />
<argument index="1" name="alternative_tile" type="int" />
2024-03-01 10:43:35 +01:00
<description>
Returns if the base tile at coordinates [param atlas_coords] has an alternative with ID [param alternative_tile].
</description>
</method>
<method name="has_tile" qualifiers="const">
<return type="bool" />
<argument index="0" name="atlas_coords" type="Vector2i" />
2024-03-01 10:43:35 +01:00
<description>
Returns if this atlas has a tile with coordinates ID [param atlas_coords].
</description>
</method>
</methods>
2024-03-10 10:36:13 +01:00
<constants>
</constants>
2024-03-01 10:43:35 +01:00
</class>