You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Add per-tile flipping and transposing
This commit is contained in:
@@ -287,5 +287,20 @@
|
||||
<constant name="TILE_ANIMATION_MODE_MAX" value="2" enum="TileAnimationMode">
|
||||
Represents the size of the [enum TileAnimationMode] enum.
|
||||
</constant>
|
||||
<constant name="TRANSFORM_FLIP_H" value="4096">
|
||||
Represents cell's horizontal flip flag. Should be used directly with [TileMap] to flip placed tiles by altering their alternative IDs.
|
||||
[codeblock]
|
||||
var alternate_id = $TileMap.get_cell_alternative_tile(0, Vector2i(2, 2))
|
||||
if not alternate_id & TileSetAtlasSource.TRANSFORM_FLIP_H:
|
||||
# If tile is not already flipped, flip it.
|
||||
$TileMap.set_cell(0, Vector2i(2, 2), source_id, atlas_coords, alternate_id | TileSetAtlasSource.TRANSFORM_FLIP_H)
|
||||
[/codeblock]
|
||||
</constant>
|
||||
<constant name="TRANSFORM_FLIP_V" value="8192">
|
||||
Represents cell's vertical flip flag. See [constant TRANSFORM_FLIP_H] for usage.
|
||||
</constant>
|
||||
<constant name="TRANSFORM_TRANSPOSE" value="16384">
|
||||
Represents cell's transposed flag. See [constant TRANSFORM_FLIP_H] for usage.
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
||||
|
||||
Reference in New Issue
Block a user