资源简介
Cocos2d-x 3.2 自动更新
使用AssetsManager更新游戏资源包

代码片段和文件信息
#include “AppDelegate.h“
#include
#include
#include “Upgrade.h“
#include “AppMacros.h“
USING_NS_CC;
using namespace std;
AppDelegate::AppDelegate() {
}
AppDelegate::~AppDelegate()
{
}
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLView::create(“Cpp Empty Test“);
director->setOpenGLView(glview);
}
director->setOpenGLView(glview);
// Set the design resolution
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
// a bug in DirectX 11 level9-x on the device prevents ResolutionPolicy::NO_BORDER from working correctly
glview->setDesignResolutionSize(designResolutionSize.width designResolutionSize.height ResolutionPolicy::SHOW_ALL);
#else
glview->setDesignResolutionSize(designResolutionSize.width designResolutionSize.height ResolutionPolicy::NO_BORDER);
#endif
Size frameSize = glview->getframeSize();
vector searchPath;
// In this demo we select resource according to the frame‘s height.
// If the resource size is different from design resolution size you need to set contentScaleFactor.
// We use the ratio of resource‘s height to the height of design resolution
// this can make sure that the resource‘s height could fit for the height of design resolution.
// if the frame‘s height is larger than the height of medium resource size select large resource.
if (frameSize.height > mediumResource.size.height)
{
searchPath.push_back(largeResource.directory);
director->setContentScaleFactor(MIN(largeResource.size.height/designResolutionSize.height largeResource.size.width/designResolutionSize.width));
}
// if the frame‘s height is larger than the height of small resource size select medium resource.
else if (frameSize.height > smallResource.size.height)
{
searchPath.push_back(mediumResource.directory);
director->setContentScaleFactor(MIN(mediumResource.size.height/designResolutionSize.height mediumResource.size.width/designResolutionSize.width));
}
// if the frame‘s height is smaller than the height of medium resource size select small resource.
else
{
searchPath.push_back(smallResource.directory);
director->setContentScaleFactor(MIN(smallResource.size.height/designResolutionSize.height smallResource.size.width/designResolutionSize.width));
}
// set searching path
FileUtils::getInstance()->setSearchPaths(searchPath);
// 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();
auto layer = Upgrade::create();
scene->addChild(layer);
// run
director->runWithScene(scene);
return true;
}
//
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3609 2014-07-28 08:40 Classes\AppDelegate.cpp
文件 947 2014-07-11 10:15 Classes\AppDelegate.h
文件 2732 2014-07-11 10:15 Classes\AppMacros.h
文件 3201 2014-07-28 09:00 Classes\HelloWorldScene.cpp
文件 594 2014-07-15 10:32 Classes\HelloWorldScene.h
文件 3908 2014-07-28 08:56 Classes\Upgrade.cpp
文件 884 2014-07-28 08:41 Classes\Upgrade.h
目录 0 2014-07-28 09:00 Classes\
相关资源
- 精美千年登陆器(自动更新).rar
- 联想g460 bios 29CN38WW(V2.15)
- 海康威视 WEB无插件开发包 V3.2
- 安国AU6989SN/SNL系列最新量产工具V16.
-
li
nksys AE1000/Cisco AM10无线网卡驱动 - 清华同方手写板万能驱动程序
- windows3.2简体中文版,虚拟机文件
- 康源建站系统最新版本V3.2
- cocos2d-x飞机大战项目
- BLE-CC254x-1.3.2 蓝牙官方源代码
- Freemarker 2.3.23 最新中文版参考手册
- 创新SoundBlaster系列声卡ALchemy炼金术辅
- Delphi KOLMCK V3.23最新版
- 戴尔d630无线网卡驱动 v1.3.2 官方最新
- 使用ATLAS探测器在3.2 fbâ1的质子
- Cocos2d-x开发游戏的坐标系知识介绍
- Apabi Reader 3.2打印成PDF软件
- Cocos2d-x 3.x 头像选择器功能扩展Image
- DELL戴尔灵越Inspiron 5520触摸板驱动程序
- 硬盘安装工具 CGI 3.2多核心,纯净且功
- 基金投资管理系统O3.2用户手册(V1.
- 交通信号灯_PLC_V1.3.20200724.1.xdp
- 光汇科技V3.27单片机开发板电路图
- Iris-0.9.3.2破解版
- 林智仁教授最新版本LibSVM工具箱
- 余闻同学录3.2b4破解版完美去后门版源
- 节奏大师源码
- 天音淘宝店铺宝贝批量复制大师V3.2
- libsvm-3.20
- nexus-3.27.0-03包含windows和linux
评论
共有 条评论