0
votes

I'm not quiet sure I understand the positioning in my cocos2d scene. I'm putting something in the middle of the scene ( or so I think ) by using

winSize = [[CCDirector sharedDirector] winSize];
_leftScrollLayer.position = ccp (winSize.width/2,winSize.height/2);

However when this loads, the layer is loaded off screen... So then I try the position (0,0), which I assume is the bottom left corner of the screen. This then loads the layer to the top right of the screen...

Not sure if I'm missing anything, I've been playing around with the scene's anchorPoint and position, but it doesn't seem to do anything.

1
Did you change the layer's or layer's parent position or anchorPoint?LearnCocos2D

1 Answers

0
votes

It sounds like you have to set the anchorPoint. Try setting it to the center of your node:

_leftScrollLayer.anchorPoint = ccp(0.5, 0.5);