Hi everyone,
I need to scale a Sprite on the Y-axis but only in one direction, is this possible?
I have only been able to scale it in both directions on the Y-axis and can't seem to find any info on this matter.
Thanks!
A fast, easy to use, free, and community supported 2D game engine
Hi everyone,
I need to scale a Sprite on the Y-axis but only in one direction, is this possible?
I have only been able to scale it in both directions on the Y-axis and can't seem to find any info on this matter.
Thanks!
Default anchorPoint for all transformations is in the middle of the sprite. So, if you want to scale sprite e.g. "down" the Y axis, you'd need to set anchorPoint to ccp(0.5,1). But be aware that your sprite's position will also change.
Thanks crmagicxxx!
Worked like a charm. I just did it with an anchor point of ccp(0.5,0) so that it scaled upward. I'll keep in mind the positioning for the next part.
OK, back to this problem now!
What happens to the anchor point when I move the Sprite? The issue now is that if the Sprite is in it's original position and I apply a wave effect for example it will look very different than what it looks like when it is in the final position. Any ideas?
Thanks again!
Anchor point is like center of mass, so it moves with the body (sprite). Never used wave effect so I don't know what you're asking actually. But I think that I read about those effects that once you're finished with them you should reset it somehow... Really don't know.
You must log in to post.