tyra
tyra copied to clipboard
Add origin getters setters to mesh/sprite
@Foxar please describe the plan if you could.
I've thought of adding a property of "Origin" or "Offset", to sprites and maybe meshes. To put it simply on example of a 2D sprite:
With the default origin, say, (0,0) (top-left corner)
sprite.setSize(20,20); sprite.setPosition(0,0); //Now the sprite's top-left corner is in 0,0, top-right corner is in 20,20, etc.
With origin setting:
sprite.setOrigin(10,10); sprite.setSize(20,20); sprite.setPosition(0,0); //Now the sprite's center is in 0,0, top-right corner is in 10,-10, top-left corner in -10,-10 etc.
What needs to be checked is how meshes behave, what is considered their point of origin, I suspect it might be relative to 0,0,0 point in a blender scene, but this is unconfirmed, so I'm leaving the question tag.
Resolved in Tyra 2.0.0