
Void AppDelegate::applicationWillEnterForeground() this function will be called when the app is active again CCDirector::sharedDirector()->stopAnimation() Void AppDelegate::applicationDidEnterBackground() When comes a phone call,it's be invoked too This function will be called when the app is inactive. PDirector->setAnimationInterval(1.0 / 60) the default value is 1.0/60 if you don't call this PDirector->setOpenGLView(CCEGLView::sharedOpenGLView()) The images has 3 different states:Ĭlass AppDelegate : private cocos2d::CCApplicationīool AppDelegate::applicationDidFinishLaunching()ĬCDirector *pDirector = CCDirector::sharedDirector() If the parent is an standard CCNode, then CCSprite behaves like any other CCTextureNode:ĬCMenuItemSprite accepts CCNode objects as items. Parallax scroller is not supported, but can be simulated with a "proxy" sprite.The Blending function property belongs to CCSpriteSheet, so you can't individually set the blending function property.The Alias/Antialias property belongs to CCSpriteSheet, so you can't individually set the aliased property.GridBase actions are not supported (eg: Lens, Ripple, Twirl).Camera is not supported yet (eg: OrbitCamera action doesn't work).It is MUCH faster if you render multiptle sprites at the same time (eg: 50 or more CCSprite nodes).Features when the parent is a CCSpriteSheet.If the parent is a CCSpriteSheet then the following features/limitations are valid It doesn't have a textureĬCSprite is a CCNode object that implements the CCFrameProtocol and CCRGBAProtocol protocols. create callbacks to handle the advancement of time.overriding init to initialize resources and schedule callbacks.Subclassing a CCNode usually means (one/all) of: Some CCNode nodes provide extra functionality for them or their children.

They can execute actions (runAction, stopAction, etc).

They can schedule periodic callback (schedule, unschedule, etc).They can contain other CCnode nodes (addChild, getChildByTag, removeChild, etc).The most popular CCNodes are: CCScene, CCLayer, CCSprite, CCMenu.

Anything thats gets drawn or contains things that get drawn is a CCNode.
Ccmenu cocos2dx plus#
This->_layerColor->setPosition(CCPointMake(0,600)) ĬCLayer is a subclass of CCNode that implements the TouchEventsDelegate protocol.Īll features from CCNode are valid, plus the following new features:ĬCNode is the main element. This->addChild(this->_menuLayerPlace,100) This->_menuLayerPlace->setPosition(CCPointMake(0,600))

This->_menuLayerPlace->setPosition(CCPointZero) This->_menuLayerPlace->setAnchorPoint(CCPointZero) This->_menuLayerPlace = CCMenu::create(this->_menuCamara, NULL) This->_menuCamara->setPosition( ((this->_menuCamara->getContentSize().width / 2 ) + 15 ), ( this->_menuLayerPlace->getContentSize().height / 2 ) ) Menu_selector(MenuLayerPlace:: camaraCallback) This->_menuCamara = CCMenuItemImage::create() This->_goPlace = this->_place->getCurrentPlace() This->_menuLayerPlace->setContentSize(CCSizeMake(480,100)) This->_menuLayerPlace = CCLayer::create()
