I am looking into rotating a cell in a TileMapLayer through code.
I get that I need to use the three transforms available in TileSetAtlasSource:
TRANSFORM_FLIP_H
TRANSFORM_FLIP_V
TRANSFORM_TRANSPOSE
However, based on my research, they have to be passed as the fifth argument to the set_cell() function.
Looking at the docs, there is no fifth argument, at least not anymore, and I’m unsure of an alternative.
TileMap.setCell (the one used in the TRANSFORM_FLIP_H example) and TileMapLayer.set_cell (the one in your set_cell() link) are different functions, the first having the layer number as the first argument, the latter obviously doesn’t need that layer number.
TileMap is depricated in favor of TileMapLayer.
Its set_cell() function call, based on the docs, also doesn’t take in a fifth argument.
The example in the TileMapLayer docs you are referring to is probably outdated.
Edit, my bad, I have it figured out.
I found an old video that used the transforms as an additional argument for the rotation.
Turns out it’s better to follow the docs… obviously
Rotation is done as described in the TileSetAtlasSource docs.
I was thrown off as it’s the first time I see this “|” syntax in gdscript. I’m guessing it’s just a bitwise “or” operation?
Either way, it works.