想开发2D游戏可以用3.6.0版本吗

是不是最好还是用2.4.13版本开发比较好 还是说3.6.0已经完全兼容了2.4.x的所有了

如果要用 2.x,那就用 2.4.13
如果要用3.x,那就用 3.8.x

看个人喜好,功能都差不多。

1赞

好的老哥 :smile:

麒麟子大神,我用了3.8.0,但是感觉我想要的效果对应api好难搜啊。首先我是新手。
比如:我想让图片动态旋转,在文档里直接搜旋转搜不到,百度了才知道有个缓动系统。然后实现了图片动态转动一定角度。
但是,我现在想让另一张图淡入淡出效果,找了百度,发现贴过来后根本没这个入参了(图中红线处报红),就算过期了也要提示下新方法是哪个吧,好难哦。image

我还是比较喜欢3.8.0的,感觉确实手感很好很舒服,但是好像很多百度或者chatgpt 智普ai上的提示都是过期的,API文档上也不知道怎么才能搜出来我想要的image image

解决了,原来透明度在3.8.0里被做成了 UIOpacity组件。这样就可以了。image

代码肯定有优化空间,但我不知道,反正感觉写起来挺臃肿的。大家知道的告诉我哈。
import { _decorator, Color, Component, easing, Node, Quat, Sprite, tween, UIOpacity, Vec3 } from ‘cc’;
const { ccclass, property } = _decorator;

@ccclass(‘StartUp’)
export class StartUp extends Component {

@property(Node)
desc:Node = null;

@property(Node)
shanzi:Node = null;

start() {
    // 渐显
    tween(this.desc.getComponent(UIOpacity))
    .by(3.0,{ opacity: 255 },{
        easing: easing.fade,
    })
    .call(
        () => {
            // 渐显
            tween(this.shanzi.getComponent(UIOpacity))
            .by(0.5, { opacity: 255 }, {
                easing: easing.smooth,
            })
            .start();
            
            // 旋转
            tween(this.shanzi)
            .to(2.0, { angle: 5 }, {
                easing: easing.smooth,
            })
            .start();  
        })
    .start();  
}

update(deltaTime: number) {
    
}

}

坐等cocos官方出AI吧。。不过。。等你的孩子用上吧。。你就没什么希望了。。

还是用 2 吧,3 基本找不到解决方案