• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setDisplayStats函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setDisplayStats函数的典型用法代码示例。如果您正苦于以下问题:C++ setDisplayStats函数的具体用法?C++ setDisplayStats怎么用?C++ setDisplayStats使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setDisplayStats函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Rect

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
	auto director = Director::getInstance();
	auto glview = director->getOpenGLView();

	if (!glview) {
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
		glview = GLViewImpl::createWithRect("oop4", Rect(0, 0, 600, 600));		
		director->setOpenGLView(glview);
#else
        glview = GLViewImpl::create("oop4");
#endif
        director->setOpenGLView(glview);
	};
		
    //FPS 조절 함수
	director->setDisplayStats(true);
    director->setAnimationInterval(1.0 / 60);

	//////////원하는 크기로 화면 재설정/////////////////

	Size frameSize = glview->getFrameSize();
    // if the frame's height is larger than the height of medium size.
    if (frameSize.height > mediumResolutionSize.height)
    {        
        director->setContentScaleFactor(MIN(largeResolutionSize.height/designResolutionSize.height, largeResolutionSize.width/designResolutionSize.width));
    }
    // if the frame's height is larger than the height of small size.
    else if (frameSize.height > smallResolutionSize.height)
    {        
        director->setContentScaleFactor(MIN(mediumResolutionSize.height/designResolutionSize.height, mediumResolutionSize.width/designResolutionSize.width));
    }
    // if the frame's height is smaller than the height of medium size.
    else
    {        
        director->setContentScaleFactor(MIN(smallResolutionSize.height/designResolutionSize.height, smallResolutionSize.width/designResolutionSize.width));
    }
	
	//////////////////화면 크기에 맞게 맵을 출력/////////////////////////////
	glview->setDesignResolutionSize(375, 375, ResolutionPolicy::NO_BORDER);

    register_all_packages();

    // create a scene. it's an autorelease object
    auto scene = GameScene::createScene();

    // run
    director->runWithScene(scene);

    return true;
}
开发者ID:ShinMyungJae,项目名称:proj4,代码行数:51,代码来源:AppDelegate.cpp


示例2: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
        glview = GLViewImpl::create("My Game");
        director->setOpenGLView(glview);
    }

    // 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);
    
    //add search
    FileUtils::getInstance()->addSearchPath("res/");
    FileUtils::getInstance()->addSearchPath("res/icon/");
    FileUtils::getInstance()->addSearchPath("res/scene/");
    FileUtils::getInstance()->addSearchPath("res/effect");
    FileUtils::getInstance()->addSearchPath("fg/");
    
    StatusManager::getInstance()->read();   //读取status
    HeroManager::getInstance()->read(); //读取herodata
    SkillManager::getInstance()->read();    //读取skilldata
    
    g_gameClientManager = new GameClientManager();
    g_gameClientManager->createNewGame();
    
    
    
    
    
    
    
    
    
    
    
    
    // create a scene. it's an autorelease object
    //auto scene = HelloWorld::createScene();
    
    auto scene = BattleReady_Scene::createScene();
    //auto scene = Team_Scene::createScene();
    //auto scene = MapMain_Scene::createScene();
    // run
    director->runWithScene(scene);

    return true;
}
开发者ID:weimingtom,项目名称:SLG_GAME,代码行数:51,代码来源:AppDelegate.cpp


示例3: Rect

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
        glview = GLViewImpl::createWithRect("SceneTransEx1", Rect(0, 0, designResolutionSize.width, designResolutionSize.height));
#else
        glview = GLViewImpl::create("SceneTransEx1");
#endif
        director->setOpenGLView(glview);
    }

    // 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);

    // Set the design resolution
    glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER);
    Size frameSize = glview->getFrameSize();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
	frameSize = Size(480, 320);
#endif
    // if the frame's height is larger than the height of medium size.
    if (frameSize.height > mediumResolutionSize.height)
    {        
        director->setContentScaleFactor(MIN(largeResolutionSize.height/designResolutionSize.height, largeResolutionSize.width/designResolutionSize.width));
    }
    // if the frame's height is larger than the height of small size.
    else if (frameSize.height > smallResolutionSize.height)
    {        
        director->setContentScaleFactor(MIN(mediumResolutionSize.height/designResolutionSize.height, mediumResolutionSize.width/designResolutionSize.width));
    }
    // if the frame's height is smaller than the height of medium size.
    else
    {        
        director->setContentScaleFactor(MIN(smallResolutionSize.height/designResolutionSize.height, smallResolutionSize.width/designResolutionSize.width));
    }

    register_all_packages();

    // create a scene. it's an autorelease object
    auto scene = HelloWorld::createScene();

    // run
    director->runWithScene(scene);

    return true;
}
开发者ID:Gasbebe,项目名称:cocos2d_source,代码行数:51,代码来源:AppDelegate.cpp


示例4: Rect

bool AppDelegate::applicationDidFinishLaunching()
{
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || \
    (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) ||   \
    (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
         glview = GLViewImpl::createWithRect("Battle of Stars", Rect(0, 0, developmentResolutionSize.width, developmentResolutionSize.height));
        // XXX: Full Screen Here!
        // glview =  GLViewImpl::createWithFullScreen("ball");
#else
        glview = GLViewImpl::create("Battle of Stars");
#endif
        director->setOpenGLView(glview);
    }

    // turn on display FPS
    director->setDisplayStats(false);

    // set FPS. the default value is 1.0/60 if you don't call this
    director->setAnimationInterval(1.0 / 60);

    // Set the design resolution
    glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER);
    Size frameSize = glview->getFrameSize();
    // if the frame's height is larger than the height of medium size.
    if (frameSize.height > mediumResolutionSize.height) {
        director->setContentScaleFactor(MIN(largeResolutionSize.height/designResolutionSize.height, largeResolutionSize.width/designResolutionSize.width));
    // if the frame's height is larger than the height of small size.
    } else if (frameSize.height > smallResolutionSize.height) {
        director->setContentScaleFactor(MIN(mediumResolutionSize.height/designResolutionSize.height, mediumResolutionSize.width/designResolutionSize.width));
    // if the frame's height is smaller than the height of medium size.
    } else {
        director->setContentScaleFactor(MIN(smallResolutionSize.height/designResolutionSize.height, smallResolutionSize.width/designResolutionSize.width));
    }

    register_all_packages();

    FileUtils::getInstance()->addSearchPath("res");
    
    // create a scene. it's an autorelease object
    //auto scene = MenuScene::createScene();
    auto scene = TransitionFade::create(1.0f, BeginScene::createScene());
    // run
    director->runWithScene(scene);

    return true;
}
开发者ID:dcalsky,项目名称:starwar,代码行数:50,代码来源:AppDelegate.cpp


示例5: Rect

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
        glview = GLViewImpl::createWithRect("SushiNeko", Rect(0, 0, 640, 960));
        director->setOpenGLView(glview);
    }
    
    glview->setDesignResolutionSize(640, 960, ResolutionPolicy::FIXED_WIDTH);
    
    // 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);

    FileUtils::getInstance()->addSearchPath("res");
    
    std::vector<std::string> searchResolutionsOrder(1);
    
    cocos2d::Size targetSize = glview->getFrameSize();
    
    if (targetSize.height < 481.0f)
    {
        searchResolutionsOrder[0] = "resources-1x";
    }
    else if (targetSize.height < 1137.0f)
    {
        searchResolutionsOrder[0] = "resources-2x";
    }
    else if (targetSize.height < 2047.0f)
    {
        searchResolutionsOrder[0] = "resources-3x";
    }
    else
    {
        searchResolutionsOrder[0] = "resources-4x";
    }
    
    FileUtils::getInstance()->setSearchResolutionsOrder(searchResolutionsOrder);
    
    // create a scene. it's an autorelease object
    auto scene = MainScene::createScene();

    // run
    director->runWithScene(scene);

    return true;
}
开发者ID:kumabotz,项目名称:SushiNeko-Cpp,代码行数:50,代码来源:AppDelegate.cpp


示例6: Rect

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
        glview = GLViewImpl::createWithRect("Archer", Rect(0, 0, designResolutionSize.width, designResolutionSize.height));
#else
        glview = GLViewImpl::create("Archer");
#endif
        director->setOpenGLView(glview);
    }

    // turn on display FPS
    director->setDisplayStats(false);

    // set FPS. the default value is 1.0/60 if you don't call this
    director->setAnimationInterval(1.0 / 60);

	//获取屏幕大小;
	auto screenSize = glview->getFrameSize();
	//设计分辨率大小;
	auto designSize = Size(1280,720);
	//资源大小;
	auto resourceSize = Size(1280, 720);
	std::vector<std::string> searchPaths;

	if (screenSize.height > 720) {	//640x1136
		designSize = Size(1920, 1080);
		searchPaths.push_back("picture");
	}
	else {
		searchPaths.push_back("picture");
	}

	director->setContentScaleFactor(resourceSize.width / designSize.width); //默认为1.0f

	FileUtils::getInstance()->setSearchPaths(searchPaths);

	glview->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::NO_BORDER);


    // create a scene. it's an autorelease object
    auto scene = HelloWorld::createScene();

    // run
    director->runWithScene(scene);

    return true;
}
开发者ID:MulticsYin,项目名称:Archer-cocos2d-x,代码行数:50,代码来源:AppDelegate.cpp


示例7: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
        glview = GLViewImpl::create("Meone Game");
        director->setOpenGLView(glview);
    }

    // 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);

    // Set the design resolution
	glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::SHOW_ALL);
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
	glview->setFrameSize(designResolutionSize.width, designResolutionSize.height);
#endif
	/*
	Size frameSize = glview->getFrameSize();
    // if the frame's height is larger than the height of medium size.
    if (frameSize.height > mediumResolutionSize.height)
    {        
        director->setContentScaleFactor(MIN(largeResolutionSize.height/designResolutionSize.height, largeResolutionSize.width/designResolutionSize.width));
    }
    // if the frame's height is larger than the height of small size.
    else if (frameSize.height > smallResolutionSize.height)
    {        
        director->setContentScaleFactor(MIN(mediumResolutionSize.height/designResolutionSize.height, mediumResolutionSize.width/designResolutionSize.width));
    }
    // if the frame's height is smaller than the height of medium size.
    else
    {        
        director->setContentScaleFactor(MIN(smallResolutionSize.height/designResolutionSize.height, smallResolutionSize.width/designResolutionSize.width));
    }
	*/
    register_all_packages();

	this->setResourceSearchResolution();

    // create a scene. it's an autorelease object
    auto scene = LoadingScene::createScene();

    // run
    director->runWithScene(scene);

    return true;
}
开发者ID:yutiya,项目名称:FlappyBird,代码行数:50,代码来源:AppDelegate.cpp


示例8: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
        glview = GLViewImpl::create("DemoTest");
		//glview->setFrameSize(1334, 750);
		//glview->setContentScaleFactor(2);
		//glview->setDesignResolutionSize(960, 512, ResolutionPolicy::FIXED_WIDTH);
        director->setOpenGLView(glview);
    }

    // turn on display FPS
    director->setDisplayStats(false);

    // set FPS. the default value is 1.0/60 if you don't call this
    director->setAnimationInterval(1.0 / 60);

   // Set the design resolution
	glview->setDesignResolutionSize(1334,750, ResolutionPolicy::NO_BORDER);
    //glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER);
	//director->setContentScaleFactor(3.2);
   /* Size frameSize = glview->getFrameSize();
    // if the frame's height is larger than the height of medium size.
    if (frameSize.height > mediumResolutionSize.height)
    {        
        director->setContentScaleFactor(MIN(largeResolutionSize.height/designResolutionSize.height, largeResolutionSize.width/designResolutionSize.width));
    }
    // if the frame's height is larger than the height of small size.
    else if (frameSize.height > smallResolutionSize.height)
    {        
        director->setContentScaleFactor(MIN(mediumResolutionSize.height/designResolutionSize.height, mediumResolutionSize.width/designResolutionSize.width));
    }
    // if the frame's height is smaller than the height of medium size.
    else
    {        
        director->setContentScaleFactor(MIN(smallResolutionSize.height/designResolutionSize.height, smallResolutionSize.width/designResolutionSize.width));
    }*/

    register_all_packages();

    // create a scene. it's an autorelease object Æðʼ³¡¾°
    auto scene = MenuScene::createScene();

    // run
    director->runWithScene(scene);

    return true;
}
开发者ID:chenqian89614,项目名称:xiaoxin,代码行数:49,代码来源:AppDelegate.cpp


示例9: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching() {
    // director and window initialisation
    auto director = Director::getInstance();
    auto eglView = EGLView::getInstance();

    director->setOpenGLView(eglView);
    director->setDisplayStats(true);
    director->setAnimationInterval(1.0 / 60);
    auto scene = HelloWorld::createScene();

    // run
    director->runWithScene(scene);

    return true;
}
开发者ID:Pisces000221,项目名称:CircularAlgoLab,代码行数:15,代码来源:AppDelegate.cpp


示例10: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching() {

    sdkbox::PluginGoogleAnalytics::init();
    sdkbox::PluginGoogleAnalytics::startSession();

    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
        glview = GLViewImpl::create("My Game");
        director->setOpenGLView(glview);
    }

    // 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);

    // Set the design resolution
    glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER);
    Size frameSize = glview->getFrameSize();
    // if the frame's height is larger than the height of medium size.
    if (frameSize.height > mediumResolutionSize.height)
    {        
        director->setContentScaleFactor(MIN(largeResolutionSize.height/designResolutionSize.height, largeResolutionSize.width/designResolutionSize.width));
    }
    // if the frame's height is larger than the height of small size.
    else if (frameSize.height > smallResolutionSize.height)
    {        
        director->setContentScaleFactor(MIN(mediumResolutionSize.height/designResolutionSize.height, mediumResolutionSize.width/designResolutionSize.width));
    }
    // if the frame's height is smaller than the height of medium size.
    else
    {        
        director->setContentScaleFactor(MIN(smallResolutionSize.height/designResolutionSize.height, smallResolutionSize.width/designResolutionSize.width));
    }

    register_all_packages();

    // create a scene. it's an autorelease object
    auto scene = HelloWorld::createScene();

    // run
    director->runWithScene(scene);

    return true;
}
开发者ID:edavidis,项目名称:sdkbox-ga-sample,代码行数:48,代码来源:AppDelegate.cpp


示例11: LOGD

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();

    Size winSize = director->getWinSize();
    if(!glview) {
        //glview = GLView::createWithRect("My Game", Rect(0, 0, winSize.width, winSize.height), 1);
        glview = GLView::create("My Game");
        //glview->setFrameSize(540, 960);
        director->setOpenGLView(glview);
    }

    //director->setContentScaleFactor(MIN(birdResource.size.height/designResolutionSize.height, birdResource.size.width/designResolutionSize.width));
    //director->setContentScaleFactor(birdResource.size.height/designResolutionSize.height);
    //director->setContentScaleFactor(birdResource.size.width/designResolutionSize.width);
    //glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::SHOW_ALL);
    //director->setContentScaleFactor(1.0);
    float scale = director->getContentScaleFactor();
    LOGD("scale is %f", scale);



    this->setResourceSearchResolution();

    // 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
    //auto scene = HelloWorld::createScene();

    auto scene = Scene::create();
    auto layer = new GameController();
    layer->autorelease();
    layer->addConsoleAutoGame();

    scene->addChild(layer);

    //auto scene = LoadingScene::create();

    // run
    director->runWithScene(scene);

    return true;
}
开发者ID:suli1,项目名称:suli1-myGame,代码行数:48,代码来源:AppDelegate.cpp


示例12: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
        glview = GLView::createWithRect("War of Planes",Rect(0,0,800,1280));//注意不要让屏幕在windows中无法显示,会出现奇葩错误,可以利用ZoomFactor调节
		//glview->setFrameZoomFactor(0.65f);
        director->setOpenGLView(glview);
    }

    // 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);


	//屏幕大小
	auto screenSize = glview->getFrameSize();

	//设计分辨率大小
	auto designSize = Size(400, 640);
	//资源大小
	auto resourceSize = Size(480, 800);

	std::vector<std::string> searchPaths;

	if (screenSize.height > 960) {	//640x1136
		designSize = Size(800, 1280);
		searchPaths.push_back("texture");
	} else {
		searchPaths.push_back("texture");
	}

	director->setContentScaleFactor(resourceSize.width/designSize.width); 

	FileUtils::getInstance()->setSearchPaths(searchPaths);

	glview->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::FIXED_WIDTH);

    // create a scene. it's an autorelease object
    auto scene = LoadingLayer::scene();
	
    // run
    director->runWithScene(scene);

    return true;
}
开发者ID:HeyUComeOn,项目名称:feijidazhan,代码行数:48,代码来源:AppDelegate.cpp


示例13: getmyStorage

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
        glview = GLViewImpl::create("HereticTrainer");
        director->setOpenGLView(glview);
	}
	
	// 存放路径
	std::vector<std::string> searchPaths;

	// 得到外部存放音乐目录
	getmyStorage(searchPaths);

	// 在mac平台调试
#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
	searchPaths.push_back("Resources/");
	searchPaths.push_back("/Users/ZHP/Animation/Lovelive/LLpractice/Play/");
	printf("%s\n", searchPaths[0].c_str());
#endif
	
	FileUtils::getInstance()->setSearchPaths(searchPaths);
	initAudioEngine();
	// 不显示屏幕信息
    director->setDisplayStats(false);
	// 分辨率匹配
	glview->setDesignResolutionSize(1080, 720, ResolutionPolicy::SHOW_ALL);
    // 设置FPS,每秒刷新60次
    director->setAnimationInterval(1.0 / 60);
	
	if (!UserDefault::getInstance()->getBoolForKey("ok")) {
		UserDefault::getInstance()->setBoolForKey("ok", true);
		UserDefault::getInstance()->setDoubleForKey("rate", 1.0);
		UserDefault::getInstance()->setDoubleForKey("baddis", 144);
		UserDefault::getInstance()->setDoubleForKey("gooddis", 80);
		UserDefault::getInstance()->setDoubleForKey("greatdis", 50);
		UserDefault::getInstance()->setDoubleForKey("perfectdis", 20);
		UserDefault::getInstance()->setDoubleForKey("offsetdis", 0);
		UserDefault::getInstance()->setDoubleForKey("touchdis", 142);
		UserDefault::getInstance()->setDoubleForKey("touchwidth", 80);
		UserDefault::getInstance()->setDoubleForKey("touchheight", 140);
		UserDefault::getInstance()->flush();
	}
	auto scene = SelectSong::createScene();
    director->runWithScene(scene);
    return true;
}
开发者ID:Jagay,项目名称:HereticTrainer,代码行数:48,代码来源:AppDelegate.cpp


示例14: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
     auto director = Director::getInstance();
	 auto glview = director->getOpenGLView();
	 if (!glview) {
		 return false;
	 }
	 glview->setFrameSize(600, 450);
    // 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
	auto scene = Scene::create();
	scene->setContentSize(Director::getInstance()->getVisibleSize());
	// run
	director->runWithScene(scene);

	Rect rect(0, 0, 4096, 2048);

	Sprite* grid = Sprite::create("grid1_16x16_new_aaa.png");

	grid->setTextureRect(rect);

	Texture2D::TexParams params = {

		GL_LINEAR,

		GL_LINEAR,

		GL_REPEAT,

		GL_REPEAT

	};

	grid->getTexture()->setTexParameters(params);
	grid->setAnchorPoint(Vec2::ZERO);
	grid->setPosition(Vec2::ZERO);

	scene->addChild(grid);
    director->runWithScene(scene);

    return true;
}
开发者ID:enhhh,项目名称:cocos2dx-MFC,代码行数:47,代码来源:AppDelegate.cpp


示例15: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
        glview = GLViewImpl::create("Starcraft");
        director->setOpenGLView(glview);
    }
    
    glview->setDesignResolutionSize(DISPLAY_WIDTH, DISPLAY_HEIGHT, ResolutionPolicy::SHOW_ALL);

    // 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);
    
    register_all_packages();
    
    ///////////////////////////로그인 서버로 접속

    if(PLAY_ALONE) {
        glview->setDesignResolutionSize(1280, 720, ResolutionPolicy::SHOW_ALL);
        auto scene = GameWorld::createScene();
        
        // run
        director->runWithScene(scene);
    }else{
        GameClient::GetInstance().Initialize();
        
        auto networkBGLayer = NetworkLayer::create();
        networkBGLayer->retain();
        
        GameClient::GetInstance().currentScene = NO_SCENE_NOW;
        
        Scene* scene = HelloWorld::createScene();
        
        scene->addChild(networkBGLayer, 0, TAG_NETWORK_LAYER);
        Director::getInstance()->runWithScene(scene);
        
        networkBGLayer->handler->frontSendFirstConnectReq();
    }

    return true;
}
开发者ID:kimeyongchan,项目名称:MobileStar,代码行数:45,代码来源:AppDelegate.cpp


示例16: Rect

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
        glview = GLViewImpl::createWithRect("CantFallTower", Rect(0, 0, 960, 640));
        director->setOpenGLView(glview);
		//屏幕适配
		glview->setDesignResolutionSize(960.0f, 640.0f, ResolutionPolicy::FIXED_HEIGHT);
		director->setContentScaleFactor(720.0f / 640.0f);
	}


    director->getOpenGLView()->setDesignResolutionSize(960, 640, ResolutionPolicy::SHOW_ALL);

    // 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);

    FileUtils::getInstance()->addSearchPath("res");
	//添加各素材路径
	FileUtils::getInstance()->addSearchPath("res/Map");
	FileUtils::getInstance()->addSearchPath("res/Enemy");
	FileUtils::getInstance()->addSearchPath("res/Tower");
	FileUtils::getInstance()->addSearchPath("res/Sprite");
	FileUtils::getInstance()->addSearchPath("res/Skill");
	FileUtils::getInstance()->addSearchPath("res/Scene");
	FileUtils::getInstance()->addSearchPath("res/Buff");
	FileUtils::getInstance()->addSearchPath("res/fonts");

	StageData::getInstance()->pushStageFileName("stage1.plist");
	StageData::getInstance()->pushStageFileName("stage2.plist");
	StageData::getInstance()->pushStageFileName("stage3.plist");

    // create a scene. it's an autorelease object
	//测试游戏场景
    //auto scene = GameScene::createScene();
	auto scene = MainScene::createScene();
    // run
    director->runWithScene(scene);

    return true;
}
开发者ID:LittleSemester,项目名称:CantFallTower,代码行数:45,代码来源:AppDelegate.cpp


示例17: Rect

bool AppDelegate::applicationDidFinishLaunching() {
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
        glview = GLViewImpl::createWithRect("ReversiCpp", Rect(0, 0, 640, 960));
        director->setOpenGLView(glview);
    }
    
    //画面サイズを固定
    director->getOpenGLView()->setDesignResolutionSize(640, 1136, ResolutionPolicy::SHOW_ALL);
    director->setDisplayStats(true);
    director->setAnimationInterval(1.0 / 60);
    FileUtils::getInstance()->addSearchPath("res");
    auto scene = Title::createScene();
    director->runWithScene(scene);

    return true;
}
开发者ID:SShayashi,项目名称:Osero,代码行数:18,代码来源:AppDelegate.cpp


示例18: Rect

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
//        glview = GLViewImpl::create("Whipping");
        glview = GLViewImpl::createWithRect("Whipping", Rect(0,0,960,540));
        director->setOpenGLView(glview);
    }
    
    // set absolute screen size
    glview->setDesignResolutionSize(1920, 1080, ResolutionPolicy::NO_BORDER);
    
    // 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);

//    Texture2D::Texture2D();
    register_all_packages();

    // create a scene. it's an autorelease object
//    auto scene = Title::createScene();
    UserDefault::getInstance()->setIntegerForKey("jejeHP", 5);
    UserDefault::getInstance()->setBoolForKey("blueKey", false);
    UserDefault::getInstance()->setBoolForKey("purpleKey", false);
    UserDefault::getInstance()->setBoolForKey("redKey", false);
    
    UserDefault::getInstance()->setIntegerForKey("fromStageKind", 0);
    UserDefault::getInstance()->setIntegerForKey("fromStageIdentity", 1);
    UserDefault::getInstance()->setIntegerForKey("stageKind", 0);
    UserDefault::getInstance()->setIntegerForKey("stageIdentity", 2);
    UserDefault::getInstance()->setIntegerForKey("doorNumber", 0);
    
    FileUtils::getInstance()->createDirectory(FileUtils::getInstance()->getWritablePath() + "projectWhipping/data/stage");
    
    auto scene = GameScene::createScene();

    // run
    director->runWithScene(scene);

    return true;
}
开发者ID:gnosy1590,项目名称:projectWhipping,代码行数:44,代码来源:AppDelegate.cpp


示例19: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
        glview = GLViewImpl::create("My Game");
        director->setOpenGLView(glview);
    }
    
     USER_DB->YemicInitDats();
    
    //////////////////////WJ 디바이스 확인해서 이미지 사이즈를 맞춘다.
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
    glview->setFrameSize(480,640);//window size
#endif
    glview->setDesignResolutionSize(DESIGN_WIDTH, DESIGN_HEIGHT, ResolutionPolicy::NO_BORDER);
    
    std::vector<std::string> searchPaths;
    if (glview->getFrameSize().width > 375) {
        searchPaths.push_back("hd");
        FileUtils::getInstance()->setSearchPaths(searchPaths);
        director->setContentScaleFactor(2);
    }else{
        searchPaths.push_back("sd");
        FileUtils::getInstance()->setSearchPaths(searchPaths);
        director->setContentScaleFactor(1);
    }
    ////////////////////////////////
    
    
    // turn on display FPS
    director->setDisplayStats(false);

    // 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
    auto scene = MainScene::createScene();

    // run
    director->runWithScene(scene);

    return true;
}
开发者ID:wonjoo,项目名称:Yemac,代码行数:44,代码来源:AppDelegate.cpp


示例20: Rect

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
        glview = GLViewImpl::createWithRect("tvapp", Rect(0, 0, designResolutionSize.width, designResolutionSize.height));
#else
        glview = GLViewImpl::create("tvapp");
#endif
        director->setOpenGLView(glview);
    }

    // turn on display FPS
    director->setDisplayStats(false);

    // set FPS. the default value is 1.0/60 if you don't call this
    director->setAnimationInterval(1.0 / 60);

    
//    SimpleAudioEngine::sharedEngine()->preloadEffect("card_shuffle.mp3");
    
    GameData::getInstance()->setCustomOrientation(0);
    GameData::getInstance()->setSoundEnabled(true);
    GameData::getInstance()->setEffectEnabled(false);
    GameData::getInstance()->setTimeMove(true);
    
    GameData::getInstance()->setRightHanded(false);
    GameData::getInstance()->setTapMove(true);
    GameData::getInstance()->setDoingAction(false);
    GameData::getInstance()->setBackgroundIndex(0);
    // Set the design resolution
    glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER);
    Size frameSize = glview->getFrameSize();

    register_all_packages();
    // create a scene. it's an autorelease object
    auto scene = LoadLayer::scene();

    // run
    director->runWithScene(scene);
    
    return true;
}
开发者ID:TopCruiser,项目名称:tvOS_Card,代码行数:44,代码来源:AppDelegate.cpp



注:本文中的setDisplayStats函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setDoubleParam函数代码示例发布时间:2022-05-30
下一篇:
C++ setDisplayName函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap