是什么东东导致的下半身不遂
我最近搞的项目也妹有这种情况
应该是相机搞出来的问题
1、我新增了一个PageMap,在PageMap里挂了个sprite放了图片,自定义layer1,然后又挂了个相机,相机可见layer1,这个相机做了x轴的旋转,让图片看起来有2.5d的效果,这个相机的Priority设成1100
2、新增一个PopControl,在上面放了个按钮,自定义layer2,然后在main.scene又挂了新的相机,可见layer2,Priority为1200
3、在PageMap的show里面调用了PopControl
4、这个时候启动预览,如果按钮在中间点,就可以点击,在边角,就不能点击
应该是相机问题导致的,但是当我把新增的相机全部删了再启动,发现还是存在这个问题,我重新创建个项目,没用到相机,是一切正常的
1赞
框架
更新
- 弹窗遮罩增加毛玻璃效果,在setting.ts中通过设置UIManager.setting.shade开启
完整更新日志
毛玻璃效果兼容性验证
H5 | Android原生 | iOS原生 | 微信小游戏 | 抖音小游戏 | OPPO小游戏 | vivo小游戏 |
---|---|---|---|---|---|---|
![]() |
引擎>=3.8.5 | 引擎>=3.8.5 | ![]() |
![]() |
未验证 | 未验证 |
—————————————————分割线——————————————————————
目前编辑器预览有问题,最终发现导致渲染异常的地方在:
cameraList.forEach(camera => {
camera.targetTexture = renderTexture; // 只要动态设置了renderTexture,整个页面就不渲染卡住了
});
director.root.pipeline.render(cameraList2);
cameraList.forEach(camera => {
camera.targetTexture = null; // 设置回null也不行
});
麻烦来个大佬给看看
我找人看一下。
编辑器预览是指在编辑器用gameview运行还是小窗得预览呢
给个demo
https://gitee.com/cocos2d-zp/xforge-ui
gameview运行,代码在UIMgrShade.ts里面
运行起来后,先点登陆进入主页面,然后那个弹窗按钮页面渲染就会卡住,我测试了383和385
试试这个 pr
cocos官方必须收编这大佬 做布道师
,试了下,gameview运行是正常的了
IOS没运行起来,报错信息反馈在了385帖子里面
我i人
又发现一个问题,如果切换到新管线,截图功能就会什么都截不到,老管线是正常的。
还是那个demo,用384或者385切换新管线。
或者有其他好办法实现全屏截图吗?
框架
扩展包
更新
- cc-store 不再基于Mobx实现响应式,构建后代码体积由200K降低至2K
import {createStore, bindStore, stopBind, watchStore, stopWatch} from 'db://pkg/@gamex/cc-store';
// store.game
export default class Game implements IStore<Game> {
// 将当前实例转成Store
constructor() {
return createStore(this); // return不可忽略
}
// 状态
name = 'cc';
count = 0;
// 更新状态
setCount(count: number) {
this.count = count;
}
}
// PageHome.ts
onCountChange() {
// 支持任意条件分支
if(app.store.game.count > 10){
this.label2.string = `count: ${app.store.game.name}`;
} else {
this.label2.string = `count: ${app.store.game.count}`;
}
}
onLoad() {
// 监听状态变化
watchStore(this.onCountChange, this);
// 状态与组件属性绑定
bindStore(this.label, 'string', () => {
return app.store.game.count.toString();
});
// 状态与节点属性绑定
bindStore(this.label.node, 'active', () => {
return app.store.game.count % 2 == 0;
});
app.store.game.setCount(10);
}
onDestroy() {
stopBind(this.label, 'string');
stopBind(this.label.node, 'active');
stopWatch(this.onCountChange, this);
}
或者这样创建响应式对象也可以
const store = createStore({
name:'cc',
count:18
})
或者这样
const store = new class {
// 将当前实例转成Store
constructor() {
return createStore(this); // return不可忽略
}
// 状态
name = 'cc';
count = 0;
// 更新状态
setCount(count: number) {
this.count = count;
}
}
2赞
大佬牛逼!
牛逼了!大佬