Skip to content

Commit 9ff72fa

Browse files
committed
Merge pull request godotengine#91330 from Goldenlion5648/cell-rotation-docs
Document 0, 90, 180, and 270 degree TileMap cell rotations
2 parents a30fbc5 + d2ea303 commit 9ff72fa

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/classes/TileSetAtlasSource.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,15 @@
295295
# If tile is not already flipped, flip it.
296296
$TileMap.set_cell(0, Vector2i(2, 2), source_id, atlas_coords, alternate_id | TileSetAtlasSource.TRANSFORM_FLIP_H)
297297
[/codeblock]
298+
[b]Note:[/b] These transformations can be combined to do the equivalent of 0, 90, 180, and 270 degree rotations, as shown below:
299+
[codeblock]
300+
enum TileTransform {
301+
ROTATE_0 = 0,
302+
ROTATE_90 = TileSetAtlasSource.TRANSFORM_TRANSPOSE | TileSetAtlasSource.TRANSFORM_FLIP_H,
303+
ROTATE_180 = TileSetAtlasSource.TRANSFORM_FLIP_H | TileSetAtlasSource.TRANSFORM_FLIP_V,
304+
ROTATE_270 = TileSetAtlasSource.TRANSFORM_TRANSPOSE | TileSetAtlasSource.TRANSFORM_FLIP_V,
305+
}
306+
[/codeblock]
298307
</constant>
299308
<constant name="TRANSFORM_FLIP_V" value="8192">
300309
Represents cell's vertical flip flag. See [constant TRANSFORM_FLIP_H] for usage.

0 commit comments

Comments
 (0)