Vervatovskis
Vervatovskis

Reputation: 2367

How to scale a CCLayer and keep its position?

At the end of the game, I want to zoom out my CCLayer to show all the sprites. When I reduce the scale, the CCLayer become smaller and centered, what I want to know is how to scale the CCLayer and keep its y=0 (Origin at the bottom of the screen). Thanks in advance.

Best regards,

Upvotes: 0

Views: 245

Answers (1)

YvesLeBorg
YvesLeBorg

Reputation: 9079

I believe that all CCNode children have an anchorPoint property. CCLayer defaults to (.5,.5) , midScreen. Try setting your layer's anchor point to (0.,0.).

Upvotes: 1

Related Questions