Posted November 01, 2022 by megamarc
This release adds a new feature: Tiles on a tiled layer and sprites can be drawn rotated 90º applying a specific flag in its attributes.
This flag existed for Tiled editor compatibility but was not used. Now the renderer processes it accordingly. Combining it with horizontal and vertical flip flags allows to rotate tile brushes and sprites in steps of 90º.
Using rotated tiled brushes in Tiled editor renders correct results.
This screenshot shows a single tiled brush drawn with all combinations of rotation, horizontal and vertical flip flags, and and the same "eagle" sprite using combination of flags to simulate all possible rotations in 90º steps clockwise.
The code for the applying the four rotations is this:
TLN_ConfigSprite(0, spriteset, 0); TLN_ConfigSprite(1, spriteset, FLAG_ROTATE | FLAG_FLIPX); TLN_ConfigSprite(2, spriteset, FLAG_FLIPX | FLAG_FLIPY); TLN_ConfigSprite(3, spriteset, FLAG_ROTATE | FLAG_FLIPY);
Right now this feature has the following restrictions:
Hope you enjoy it!