I have a simple class that extends CCLayer. The constructor looks like so:
//initialize the sun
sun = Sun::create(world, 20);
CCSprite *sprite = CCSprite::create("Icon.png");
When I add the sprite to the layer it is added as if the anchor point is still ccp(0,0). How can I set the anchor point of the layer to ccp(0.5,0.5)? Also, bonus question, how do I format code properly to display in the forum?