tyra icon indicating copy to clipboard operation
tyra copied to clipboard

Add origin getters setters to mesh/sprite

Open h4570 opened this issue 3 years ago • 1 comments

@Foxar please describe the plan if you could.

h4570 avatar Dec 04 '20 08:12 h4570

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.

Foxar avatar Dec 04 '20 14:12 Foxar

Resolved in Tyra 2.0.0

h4570 avatar Aug 24 '22 21:08 h4570