Saturday, April 23, 2016

ccsprite texture rect changes based on parent scaling?

Leave a Comment

I am using Cocos2d 2.2, and am experiencing the following:

I have a sprite added as a child to a CCNode. The sprite's anchor point is 0,0. The CCNode's anchor point is 0,0. I've got a CCNode with an anchor point of 0.5,0.5 and in it I add a child with the following rect: 0,363,165,231).

I then add that CCNode as a child to another CCNode with an anchor point of 0,0...

All is well.. Looks perfect.

I scale that CCNode down to 0.5

All of a sudden, I see at the top of my sprite, garbage from the texture that is not part of it's texture rect.

Why in the world does scaling down a CCNode change the texture coordinates?!

Note, if the CCNode has an anchor point of 0,0 this doesn't happen. Only when its 0.5, 0.5...

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment