当前位置:网站首页>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;
。原因:防止输入框控件在键盘位置之下会自动顶起边栏推荐
猜你喜欢

The MySQL database in Alibaba Cloud was attacked, and the data was finally recovered

The latest MySql installation teaching, very detailed

数字孪生将成为进入“元宇宙”一项重要的途径

Memcached :安装
初识正则表达式

场效应管 | N-mos内部结构详解

动态规划(一)| 斐波那契数列和归递
![[Elastic-Job source code analysis] - job listener](/img/99/5e047b1aa83aad7d7f17b4eec606e6.png)
[Elastic-Job source code analysis] - job listener

Digital twins will be an important way to enter the "metaverse"

Powershell中UTF-8环境中文乱码解决办法
随机推荐
【云原生】SQL(及存储过程)跑得太慢怎么办?
mysql启动报错The server quit without updating PID file几种解决办法
quick-3.5 ActionTimeline的setLastFrameCallFunc调用会崩溃问题
About integrating superset into your own project
How MySQL - depots table?A look at will understand
leetcode-2321. 拼接数组的最大分数(差分+枚举)
Several solutions for mysql startup error The server quit without updating PID file
2021美赛C题M奖思路
flutter 混合开发 module 依赖
For penetration testing methods where the output point is a timestamp (take Oracle database as an example)
[JVM Loading]---Class Loading Mechanism
在kali上搭建vulhub漏洞靶场
著名网站msdn.itellyou.cn原理分析
Access数据库的查询
What is an EVM Compatible Chain?
Using IIS10 to build an asp website in win11
kotlin 插件更新到1.3.21
DeFi 项目中的治理Token
GUCCI、LV等奢侈品巨头如何布局元宇宙的,其他品牌应该跟上吗?
代码执行漏洞