#include "AppDelegate.h"

#include "HelloWorldScene.h"





USING_NS_CC;





AppDelegate::AppDelegate() 

{

//构造函数

}





AppDelegate::~AppDelegate() 

{

//析构函数

}





//程序启动完毕后进入这种方法/函数

bool AppDelegate::applicationDidFinishLaunching() {

    // initialize director初始化导演类

    CCDirector* pDirector = CCDirector::sharedDirector();

    CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();

//设置oppenGL视图

    pDirector->setOpenGLView(pEGLView);



    // turn on display FPS是否打开FPS

    pDirector->setDisplayStats(true);





    // set FPS. the default value is 1.0/60 if you don't call this设置帧数 默认60帧

    pDirector->setAnimationInterval(1.0 / 60);





    // create a scene. it's an autorelease object创建一个场景

    CCScene *pScene = HelloWorld::scene();





    // run游戏真正的開始

    pDirector->runWithScene(pScene);





    return true;

}





// This function will be called when the app is inactive. When comes a phone call,it's be invoked too

//当程序进入后台,比方电话called

void AppDelegate::applicationDidEnterBackground() {

    CCDirector::sharedDirector()->stopAnimation();





    // if you use SimpleAudioEngine, it must be pause声音暂停

    // SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();

}





// this function will be called when the app is active again

//当程序又一次被激活

void AppDelegate::applicationWillEnterForeground() {

    CCDirector::sharedDirector()->startAnimation();





    // if you use SimpleAudioEngine, it must resume here声音恢复

    // SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();

}

cocos2d-x创建第一个项目的更多相关文章

  1. Django 创建第一个项目(转)

    转自(http://www.runoob.com/django/django-first-app.html) 前面写了不少python程序,由于之前都是作为工具用,所以命令行就足够了,最近写的测试用例 ...

  2. Angular安装及创建第一个项目

    Angular简介 AngularJS 诞生于2009年,由Misko Hevery 等人创建,后为Google所收购.是一款优秀的前端JS框架,已经被用于Google的多款产品当中.AngularJ ...

  3. python+Django创建第一个项目

    1.首先搭建好环境 1.1 安装pyhton,Linux系统中,python是系统自带的所以就不用安装 1.2 安装Django框架 使用pip安装: pip install django 1.3 检 ...

  4. 【3】Django创建第一个项目

    天地所以能长且久者,以其不自生,故能长生. --老子<道德经> 写在前面:Django在学习的过程中,我们会参考官方文档,从两部分进行讲解,第一部分主要是一个入门项目的搭建开发,第二部分是 ...

  5. 吴裕雄--天生自然Django框架开发笔记:Django 创建第一个项目

    Django 管理工具 安装 Django 之后,您现在应该已经有了可用的管理工具 django-admin.可以使用 django-admin 来创建一个项目: 可以来看下django-admin ...

  6. django创建第一个项目helloworld

    环境:centos 7,已安装python 3.6环境 1.安装django并创建django第一个项目 1.1.使用pip安装django# pip install Django或指定安装版本# p ...

  7. Cocos从入门到精通--《创建第一个项目:HelloWorld》

    上节课我们解说了cocos2-x v3.7版本号的下载安装,也展示了使用CocosStudio编译不同平台运行程序的方法,大家是不是对新版本号的Cocos引擎充满期待?今天我们就创建一个project ...

  8. 用Maven创建第一个项目

    1.在Eclipse左侧的空白处点击鼠标右键,选择:New>Other : 2.选择Maven项目,点击"Next"按钮: 3.保持默认,直接点击“Next”按钮: 4.选择 ...

  9. cocos2d-x游戏开发(二)之创建第一个项目

    配置好开发环境之后,尝试创建一个cocos项目 (1)打开cocos2d-x安装目录,如D:\DIY\cocos2d-x-3.3 看到目录下有可执行文件 download-deps 以及 setup ...

  10. 一、Spring Boot系列:通过Maven创建第一个项目

    1.打开idea选择创建工程 2.创建maven工程,同时选择jdk1.8 注意:不需要勾选其他选项 3.填写项目名称 4.创建好maven项目后,在pom.xml文件中导入Spring Boot需要 ...

随机推荐

  1. C#学习笔记——常量、字段以及事件

    一 常量与字段 (一) 常量 常量总是被视为静态成员,而不是实例成员.定义常量将导致创建元数据.代码引用一个常量时,编译器会在定义常量的程序集的元数据中查找该符号,提取常量的值,并将值嵌入IL中.由于 ...

  2. GMTC2019会后:做一场冷门的技术专场是什么体验

    上周四(6.20)GMTC2019大会的第一天,很荣幸作为「UI与图形渲染」专场出品人获得了与图形领域几位技术专家同场交流的机会. 图形技术在前端范畴内是一个相对小众的话题,虽然前端工程师几乎每天都在 ...

  3. [PReact] Integrate Redux with Preact

    Redux is one of the most popular state-management libraries and although not specific to React, it i ...

  4. get_mysql_conn_info.py

    #!/usr/bin/env python#-*- encoding: utf8 -*- import xlrd """此模块作用:从excel文件获取数据库连接信息,第 ...

  5. [Scss Flex] Reuse Flexbox Styles With A Sass Mixin

    This lesson covers flexbox in a reusable mixin that should cover most layout situations on your site ...

  6. glide 安装

    glide是go的一个包管理工具 参考了 https://studygolang.com/articles/10453?fr=email 遇到的问题是,用了 go get githubXXXXX去下载 ...

  7. 数据类型总结——Number(数值类型)

    相关文章 简书原文:https://www.jianshu.com/p/9fb573ef10da 数据类型总结——概述:https://www.cnblogs.com/shcrk/p/9266015. ...

  8. Spring boot(一) 入门

    本系列基于Eclipse 4.7 .JDK 8 一.下载STS (1)STS 注意自己的eclipse版本. 在 Update Site Archives 里面选择对应eclipse的版本下载. (2 ...

  9. oracle 基础表 mysql版

    emp 员工表(empno 员工号/ename 员工姓名/job 工作/mgr 上级编号/hiredate 受雇日期/sal 薪金/comm 佣金/deptno 部门编号) dept 部门表(dept ...

  10. [React Router v4] Use Regular Expressions with Routes

    We can use regular expressions to more precisely define the paths to our routes in React Router v4. ...