Hi everyone,
I'm facing huge problems with getting and setting the position of a sprite after I set the center.
I know that there are methods to transform to global/local coordinates, but I think that these methodes are not good here, because they also apply rotating and more things, which should not be taken into consideration.
By default the center is on the top left corner (0,0), but I need to set it to the real center (width/2, height/2) so that rotation works the way I need it.
But when I then want to get/set the position I get lots of problems, because the positions I get / set seem to be no longer the left top corner, but the middle (the real center).
I tried to handle this with methods which subtract the half of the center before getting/setting, but this doesent work good, because if i for example use somethign like
setPosition(getPosition); //modified setters/getters which subtract half of center
It will do strange changes...
I'm a bit confused, maybe I have to substract for getting and add for setting or the other way round?
There must be some better approches...
Please help :-)