本文整理汇总了C++中CCDirector::runWithScene方法的典型用法代码示例。如果您正苦于以下问题:C++ CCDirector::runWithScene方法的具体用法?C++ CCDirector::runWithScene怎么用?C++ CCDirector::runWithScene使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCDirector
的用法示例。
在下文中一共展示了CCDirector::runWithScene方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
CCDirector* pDirector = CCDirector::sharedDirector();
CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();
pDirector->setOpenGLView(pEGLView);
// turn on display FPS
pDirector->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
//CCScene *pScene = GameScreen::create();
CCScene *pScene = GameMenu::create();
// run
pDirector->runWithScene(pScene);
return true;
}
示例2: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching()
{
PublicMsgHandler* pMsgHandler=new PublicMsgHandler();
// initialize director
CCDirector *pDirector = CCDirector::sharedDirector();
pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
// turn on display FPS
pDirector->setDisplayStats(false);
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
CCScene *pScene = HelloWorld::scene(pMsgHandler);
// run
pDirector->runWithScene(pScene);
return true;
}
示例3: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
CCDirector* pDirector = CCDirector::sharedDirector();
CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();
pDirector->setOpenGLView(pEGLView);
// pEGLView->setFrameSize(480,800);
pEGLView->setDesignResolutionSize(DESIGN_SCREEN_SIZE_W,DESIGN_SCREEN_SIZE_H, kResolutionShowAll);
// turn on display FPS
pDirector->setDisplayStats(!true);
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
CCScene *pScene = MainMenuLoadingScene::scene();
// run
pDirector->runWithScene(pScene);
return true;
}
示例4: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
CCDirector *pDirector = CCDirector::sharedDirector();
pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
// turn on display FPS
pDirector->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
//初始化动画管理器
sAnimationMgr->initAnimationMap();
// create a scene. it's an autorelease object
CCScene *pScene = GameScene::playNewGame();
//CCScene *pScene = HelloWorld::scene();
// run
pDirector->runWithScene(pScene);
return true;
}
示例5: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
CCDirector* pDirector = CCDirector::sharedDirector();
CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();
pDirector->setOpenGLView(pEGLView);
// turn on display FPS
pDirector->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
pEGLView->setDesignResolutionSize(960, 640, kResolutionShowAll);
// create a scene. it's an autorelease object
CCScene *pScene = HelloWorld::scene();
// run
pDirector->runWithScene(pScene);
return true;
}
示例6: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
CCDirector *pDirector = CCDirector::sharedDirector();
pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
CCEGLView::sharedOpenGLView()->setDesignResolutionSize(480, 320, kResolutionExactFit);
// turn on display FPS
//pDirector->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
CCScene *pScene = GameScene_Match::create();
// run
pDirector->runWithScene(pScene);
return true;
}
示例7: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
CCDirector *pDirector = CCDirector::sharedDirector();
//pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
CCSize screenSize = pDirector->getWinSize();
CCLOG("%f %f", screenSize.width, screenSize.height);
//CCSize screenSize = pEGLView->getFrameSize();
//CCEGLView::sharedOpenGLView() -> setDesignResolutionSize(768, 1024, kResolutionExactFit);
if (screenSize.width > 768) {
CCLOG("hd");
CCFileUtils::sharedFileUtils()->addSearchPath("hd");
pDirector->setContentScaleFactor(2);
} else {
CCLOG("SD");
//or else, use standard definition
CCFileUtils::sharedFileUtils()->addSearchPath("sd");
pDirector->setContentScaleFactor(1);
}
SimpleAudioEngine::sharedEngine()->preloadEffect(CCFileUtils::sharedFileUtils()->fullPathForFilename("hit.wav").c_str());
SimpleAudioEngine::sharedEngine()->preloadEffect(CCFileUtils::sharedFileUtils()->fullPathForFilename("score.wav").c_str());
AVAudioSession
// turn on display FPS
pDirector->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
CCScene *pScene = GameLayer::scene();
// run
pDirector->runWithScene(pScene);
return true;
}
示例8: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
CCDirector* pDirector = CCDirector::sharedDirector();
CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();
pDirector->setOpenGLView(pEGLView);
CCSize screenSize = CCEGLView::sharedOpenGLView()->getFrameSize();
CCSize designSize = CCSizeMake(480, 320);
CCFileUtils* pFileUtils = CCFileUtils::sharedFileUtils();
if (screenSize.height > 320)
{
CCSize resourceSize = CCSizeMake(960, 640);
std::vector<std::string> searchPaths;
searchPaths.push_back("hd");
pFileUtils->setSearchPaths(searchPaths);
pDirector->setContentScaleFactor(resourceSize.height/designSize.height);
}
CCEGLView::sharedOpenGLView()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionShowAll);
// turn on display FPS
// pDirector->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
CocosGUITestScene* pScene = new CocosGUITestScene();
// run
pDirector->runWithScene(pScene);
return true;
}
示例9: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
CCDirector* pDirector = CCDirector::sharedDirector();
pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
CCSize screenSize = CCEGLView::sharedOpenGLView()->getFrameSize();
CCSize designSize = CCSizeMake(480,320);
std::vector<std::string> searchPaths;
if(screenSize.height>320) {
searchPaths.push_back("HD");
searchPaths.push_back("SD");
pDirector->setContentScaleFactor(640.0f/designSize.height);
}
else {
searchPaths.push_back("SD");
pDirector->setContentScaleFactor(320.0f/designSize.height);
}
CCFileUtils::sharedFileUtils()->setSearchPaths(searchPaths);
CCEGLView::sharedOpenGLView()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionNoBorder);
// turn on display FPS
pDirector->setDisplayStats(false);
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
CCScene* pScene = StartScene::create();
// run
pDirector->runWithScene(pScene);
return true;
}
示例10: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching()
{
/*CCUserDefault* myUserDefault=CCUserDefault::sharedUserDefault();
if (myUserDefault->getBoolForKey(KEY_IS_FIRST_RUN,true))
{
myUserDefault->setBoolForKey(KEY_IS_FIRST_RUN,false);
CCLOG("first");
}else
{
CCLOG("not first");
}*/
// initialize director
CCDirector *pDirector = CCDirector::sharedDirector();
pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
CCSize designSize=CCSizeMake(800,480);
CCEGLView::sharedOpenGLView()->setDesignResolutionSize(designSize.width,designSize.height,kResolutionExactFit);
// turn on display FPS
pDirector->setDisplayStats(false);
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
//CCScene *pScene = HelloWorld::scene();
// run
pDirector->runWithScene(StartLayer::scene());
//pDirector->runWithScene(SurpriseLayer::scene());
return true;
}
示例11: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
CCDirector* director = CCDirector::sharedDirector();
director->setOpenGLView(CCEGLView::sharedOpenGLView());
// turn on display FPS
director->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
CCScene * scene = CCScene::create();
GameScreen * gameScreen = GameScreen::create();
scene->addChild(gameScreen);
// run
director->runWithScene(scene);
return true;
}
示例12: RunApplication
void GSceneSelector::RunApplication()
{
GnSrand( time( 0 ) );
// initialize director
CCDirector *pDirector = CCDirector::sharedDirector();
pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView());
pDirector->setDisplayFPS(true);
pDirector->setAnimationInterval(1.0 / 60);
CreatePlayingData();
GScene* gameScene = CreateStartScene();
if( gameScene )
pDirector->runWithScene( gameScene );
SetCurrentScene( gameScene );
CCDirector::sharedDirector()->setDisplayFPS(false);
}
示例13: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
CCDirector* pDirector = CCDirector::sharedDirector();
CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();
pDirector->setOpenGLView(pEGLView);
CCSize frameSize = pEGLView->getFrameSize();
// Set the design resolution
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
pEGLView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, kResolutionShowAll);
#else
pEGLView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, kResolutionNoBorder);
#endif
//ÉèÖÃcontentScaleFactor
pDirector->setContentScaleFactor(1);//µ±×ÊÔ´³ß´çÓëdesign³ß´ç²»Í¬Ê±ÐèҪʹÓÃËüÀ´½øÐÐËõ·Å
// set searching path
vector<string> searchPath;
searchPath.push_back(resourceSearchDic);
CCFileUtils::sharedFileUtils()->setSearchPaths(searchPath);
// turn on display FPS
pDirector->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
CCScene *pScene = HelloWorld::scene();
// run
pDirector->runWithScene(pScene);
return true;
}
示例14: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
CCDirector *pDirector = CCDirector::sharedDirector();
if (! pDirector->setDirectorType(kCCDirectorTypeDisplayLink)) {
pDirector->setDirectorType(kCCDirectorTypeDefault);
}
pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView());
// enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices.
// pDirector->enableRetinaDisplay(true);
// sets landscape mode
// pDirector->setDeviceOrientation(kCCDeviceOrientationLandscapeLeft);
// turn on display FPS
pDirector->setDisplayFPS(true);
pDirector->setDepthTest(false);
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
CCTexture2D::setDefaultAlphaPixelFormat(kCCTexture2DPixelFormat_RGBA8888);
/*
// create a scene. it's an autorelease object
CCScene *pScene = HelloWorld::scene();
// run
pDirector->runWithScene(pScene);
*/
pDirector->runWithScene(GameLayer::scene());
return true;
}
示例15: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
CCDirector* pDirector = CCDirector::sharedDirector();
CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();
pDirector->setOpenGLView(pEGLView);
// turn on display FPS
pDirector->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
CCScene *pScene = HelloWorld::scene();
// run
pDirector->runWithScene(pScene);
int appID = YOUR_APP_ID;
const char *secrect = "YOUR_APP_SECRET";
GPEnvironment environment = GPEnvironmentDevelopment;
bool debug = true;
EGPOption option = EGPOptionAll;
const char *senderID = "YOUR_SENDER_ID";
GrowthPush::initialize(appID, secrect, environment, debug, option);
GrowthPush::registerDeviceToken(senderID);
GrowthPush::setDeviceTags();
GrowthPush::trackEvent("Event");
GrowthPush::trackEvent("Event", "Value");
GrowthPush::setTag("Tag");
GrowthPush::setTag("Tag", "Value");
GrowthPush::clearBadge();
GrowthPush::launchWithNotification(this, gp_remote_notification_selector(AppDelegate::didReceiveRemoteNotification));
return true;
}