示例#1
0
CCScene* CCESceneWindow::createScene(CCESceneWindow* subClassObj, const char* preloadListXml, 
		bool cleanTextureCache, bool checkTextrueSize)
{
    CCScene * scene = NULL;
    do 
    {
        scene = CCScene::create();
        CC_BREAK_IF(! scene);
		
		scene->setAnchorPoint(ccp(0,0));
		
		CCESceneWindow *pwin = subClassObj;
		if(pwin && pwin->initCCESceneWindow(preloadListXml, cleanTextureCache, checkTextrueSize))
		{
			scene->addChild(pwin);
			pwin->release();
		}
		else
		{
			CC_SAFE_DELETE(pwin);
		}
    } while (0);

    return scene;
}
示例#2
0
// *************************************************************************************************
// scene
// *************************************************************************************************
CCScene* HelloWorld::scene()
{
	// 'scene' is an autorelease object
	CCScene *scene = CCScene::node();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
	scene->setScaleX(CCDirector::sharedDirector()->getWinSize().width/1280.0f);
    scene->setScaleY(CCDirector::sharedDirector()->getWinSize().height/720.0f);
    scene->setAnchorPoint(ccp(0,0));
#endif
    
	// 'layer' is an autorelease object
	layerStore = HelloWorld::node();
    layerIap = IAP_TYPE::node();
    
	// add layer as a child to scene
	scene->addChild(layerStore);
    scene->addChild(layerIap);

	// return the scene
	return scene;
}