Sprite scale to wrong size when you add it on another sprite ?

Sprite scale to wrong size when you add it on another sprite ?
0.0 0


Before I run deep into code logic, I want to ask if someone has this problem too.

I have a layer and 3 sprites: s1, s2 and s3.

If I add s1, s2 and s3 as layer’s child, and the scale is perfect, without any problems.

But if I add s1 as layer’s child, s2 as s1’s child and s3 as s2’s child.

It will be wrong scale size on iPhone, but seems fine on iPhone Retina.

I still don’t know why right now, but I may try to trace the code to find what happened later.

BTW, these three sprites will be scaled to 0.5 on iPhone(480x320), because I share the textures between iPhone Retina and iPhone.

Thank you.



I found the problem myself.

There is one thing that I didn’t aware before.

If you add a CCNode as another’s child, and this CCNode will be inherited some properties of it’s parent’s.

Scale is the property it will be inherited.

So, I scale the s1 to 0.5 on iPhone and it’s child - s2 will also become 0.5 on scale size.

That’s why I get wrong sprite size on iPhone(480x320).


You are right, that happen to me too, but still kind of buggy, child must have the ability to override parent properties.