当前位置:网站首页>cocos2d-x-3.x 修改和纪录
cocos2d-x-3.x 修改和纪录
2022-07-31 05:15:00 【xuyid】
1.瓦格地图在程序中显示有缝隙
ccConfig.h 92行修改 #define CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL 1
2.修改cocostudio导出的动画png图片改成pvr.ccz格式
DataReaderHelper.ccp 1333行修改
filePath = filePath.erase(filePath.find_last_of("0"));
std::string plistPath = filePath + ".plist";
std::string pngPath = filePath + ".pvr.ccz";
ArmatureDataManager::getInstance()->addSpriteFrameFromFile((dataInfo->baseFilePath + plistPath).c_str(), (dataInfo->baseFilePath + pngPath).c_str(), dataInfo->filename.c_str());
break;
3.子节点随父节点透明度变化
父节点设置setCascadeOpacityEnabled(true);
4.加载cocostudio2.x导出的csb文件,播放场景动画
auto cscene = CSLoader::createNode("map1.csb");
this->addChild(cscene);
cocostudio::timeline::ActionTimeline *action = CSLoader::createTimeline("map1.csb");
if (action) {//播放场景动画
action->gotoFrameAndPlay(0);
cscene->runAction(action);
}
//帧事件监听
action->setFrameEventCallFunc(CC_CALLBACK_1(GameScene::onFrameEvent, this));
void GameScene::onFrameEvent(Frame* frame)//固定的格式
{
EventFrame* evnt = dynamic_cast<EventFrame*>(frame);
if(!evnt)
return;
std::string str = evnt->getEvent();
if (str == "action1")
{
}
}
AppController.mm 添加
[UIApplication sharedApplication].idleTimerDisabled = YES;//保持屏幕常亮
6.安卓返回按键修改
Cocos2dxGLSurfaceView.java 295行
Cocos2dxVideoHelper.mVideoHandler.sendEmptyMessage(Cocos2dxVideoHelper.KeyEventBack);
修改为return super.onKeyDown(pKeyCode, pKeyEvent);
7.
-(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)dis
dis = 0;
。原因:防止输入框控件在键盘位置之下会自动顶起边栏推荐
猜你喜欢

继承、Super,重写、抽象类、抽象方法 1(第七天)

永恒之蓝漏洞复现

js中的this指向与原型对象

年终总结——岁月静好~

npm WARN config global `--global`, `--local` are deprecated. Use `--location解决方案

What is the difference between NFT and digital collection?
![[Cloud native] Ribbon is no longer used at the bottom layer of OpenFeign starting from the 2020.0.X version](/img/7e/1d27e3f1856ab8c6cbfc5221c717bb.png)
[Cloud native] Ribbon is no longer used at the bottom layer of OpenFeign starting from the 2020.0.X version

Powershell中UTF-8环境中文乱码解决办法

vulhub靶场学习日记SickOs1.2

安装Multisim出现 No software will be installed or removed解决方法
随机推荐
MySql to create data tables
CMOS管原理,及其在推挽电路中的应用
对js的数组的理解
(Crypto必备干货)详细分析目前NFT的几大交易市场
Linux中mysql密码修改方法(亲测可用)
File operations in C language (1)
【Elastic-Job】分布式调度任务概览篇
flutter arr 依赖
2021年京东数据分析工程师秋招笔试编程题
js中流程控制语句
阿里云中mysql数据库被攻击了,最终数据找回来了
MySQL面试题大全(陆续更新)
安装Multisim出现 No software will be installed or removed解决方法
Redis:安装使用
Year-end summary - the years are quiet~
计网 Packet Tracer仿真 | 简单易懂集线器和交换机对比(理论+仿真)
【云原生】开源数据分析 SPL 轻松应对 T+0
继承、Super,重写、抽象类、抽象方法 1(第七天)
NFTs: The Heart of Digital Ownership
年终总结——岁月静好~