2D Toolkit Forum
2D Toolkit => Support => Topic started by: pdform on February 05, 2013, 11:41:54 pm
-
Hi,
I've noticed that if you flip a sprite on the editor, the sprite's anchor keeps working as expected, however, if you flip it on runtime, some crazy behavior occurs. For instance, I've set a center anchor, and called FlipX on a sprite. Since the anchor is in the center, I'd expect the sprite to be flipped around the center, so the anchor would still be at the center, however, I observe it changes to pos.x - sprite width / 2. Is it normal?
Thanks!
-
How have you set up the anchor?
-
I've set it in the sprite collection, via editor. In my code I just call FlipX, I do not change the anchor anytime...
-
What platform are you testing this on? It only happens when you're running the game in the player right?
-
I haven't actually tested the current game in any target platform, only on the player. However, I remember having the same problem with iOS and Android in the final build, for another game. In that situation I had to treat specifically the case when the sprite's scale was negative, i.e, the sprite was flipped, to reposition it to the correct coordinates (for the new anchor).
-
I just tried this and I can't reproduce it. Can you send me a test case to support@unikronsoftware.com to look at it?
-
OK, I will. Thanks!