Showing posts with label cocos2D. Show all posts
Showing posts with label cocos2D. Show all posts

Sprite Anchor

iPhone cocos2d Tips & Tricks

[sprite setTransformAnchor:ccp(0,0)]; //lower left
or
[sprite setAnchorPoint:ccp(0,0)]

scene transition

iPhone cocos2d Tips & Tricks

[[Director sharedDirector] replaceScene:[RotoZoomTransition transitionWithDuration:1.0 scene:scene]];



see: cocos2d/Transition.h

fix gradient

iPhone cocos2d Tips & Tricks

[[Director sharedDirector] setPixelFormat:kRGBA8];

add and run scene object

iPhone cocos2d Tips & Tricks

[[Director sharedDirector] runWithScene:scene];

attach the window to cocos2d director

iPhone cocos2d Tips & Tricks

[[Director sharedDirector] attachInWindow:window];

Landscape view

iPhone cocos2d Tips & Tricks

[[Director sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft];

or

[[Director sharedDirector] setLandscape: YES];

or

[application setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated:NO];