NightmareApps/MarteEngine — comment on commit 7a22137dfa0ce744422078e40cff210d1c8166b7
File:  line 0
By NightmareApps:

Yea
Yeah that does sound simpler.. make the default corx/cory 0,0 and if it's centered and 0,0 make it the center.. else its gonna be the value that you entered with setCenterOfRotation
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

Thomas Haaks wrote:

Thanks for your support, Trent, highly appreciated!

But I think this code could be simplified ;-)

Right now "centered" and "setCenterOfRotation" are doing nearly the same.
We should remove one of those and use corX, corY for the proper coordinates of the center of rotation. So the calculation
xpos -= w;
ypos -= h;
should be removed and placed somewhere else to initialize corX and corY properly to the center of the image.

An entity is "centered" if it uses corX, corY. You can then use setCenterOfRotation(x,y) to move the center.

Is it clear what I mean?

Cheers,
Tommy

--
Reply to this email directly or view it on GitHub:
https://github.com/NightmareApps/MarteEngine/commit/7a22137dfa0ce744422078e40cff210d1c8166b7#commitcomment-687309