当前位置:网站首页>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;
。原因:防止输入框控件在键盘位置之下会自动顶起边栏推荐
- Xiaobai learns reptiles - introduction to reptiles
- PHP中abstract(抽象)、final(最终)和static(静态)原理与用法
- [uiautomation] Get WeChat friend list (stored in txt)
- 数字孪生将成为进入“元宇宙”一项重要的途径
- 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
- 一个简单的bash转powershell案例
- File operations in C language (1)
- quick-3.5 ActionTimeline的setLastFrameCallFunc调用会崩溃问题
猜你喜欢
Android软件安全与逆向分析阅读笔记
[Cloud Native] What should I do if SQL (and stored procedures) run too slowly?
DeFi Token in the project management
Install mysqldb in mac10.14
动态规划(一)| 斐波那契数列和归递
MySQL压缩包方式安装,傻瓜式教学
Take you to understand the MySQL isolation level, what happens when two transactions operate on the same row of data at the same time?
vulhub靶场学习日记xxe-lab
Hyper-V新建虚拟机注意事项
初识正则表达式
随机推荐
代码执行漏洞
为什么redis是单线程还那么快?
阿里一面,说说你知道消息中间件的应用场景有哪些?
win11中利用IIS10搭建asp网站
[Elastic-Job] Overview of Distributed Scheduling Tasks
Linux modify MySQL database password
腾讯云GPU桌面服务器驱动安装
计网 Packet Tracer仿真 | 简单易懂集线器和交换机对比(理论+仿真)
vulhub靶场学习日记hackme1
[Cloud native] Open source data analysis SPL easily copes with T+0
GUCCI、LV等奢侈品巨头如何布局元宇宙的,其他品牌应该跟上吗?
About integrating superset into your own project
js中流程控制语句
MySql创建数据表
PHP中abstract(抽象)、final(最终)和static(静态)原理与用法
[uiautomation] Get WeChat friend list (stored in txt)
mysql password modification method in Linux (pro-test available)
MySQL-如何分库分表?一看就懂
局部变量成员变量、引用类型、this,static(第五天)
powershell统计文件夹大小