You can support the development on the Github Sponsors page.


Tools > SPRITE ROTATION


Sprite rotation along x,y,z axes.
made by Skeptim with ChatGPT
uploaded by Skeptim
added:
updated:
download cartridge
- CLICK TO PLAY -

4


Open source sprite rotation function along x, y and z axes.

Copy-paste the function line 24-126 to your cart and use it!

sprite_rotation(x, y, z, angx, angy, angz, u1, v1, u2, v2, u3, v3, u4, v4, scale, chromakey, u0, v0)

- angx, angy, angz correspond to the rotation angles along x, y and z axes in radians.
- u0, v0 correspond to the center of rotation in the sprite coordinates.
Center of the sprite is u0=(u1+u3)/2 and v0=(v1+v3)/2.
- the other arguments are described in the ttri documentation https://github.com/nesbox/TIC-80/wiki/ttri

_Edit_: Allow rectangle sprites, added rotation center parameters (u0, v0), corrected chromakey.


Post comment