Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.0 升级指南 #2825

Closed
tiansu opened this issue Dec 2, 2023 · 1 comment
Closed

v3.0 升级指南 #2825

tiansu opened this issue Dec 2, 2023 · 1 comment

Comments

@tiansu
Copy link

tiansu commented Dec 2, 2023

URL : https://github.com/cocos-creator/creator-docs/blob/master/zh/release-notes/upgrade-guide-v3.0.md

// 访问坐标轴
let xAxis = this.node.position.x;
// 修改 X 轴坐标
this.node.setPosition(200);

不需要设置y值吗?
this.node.setPosition(200);

// cc.d.ts
...

/**
         * @en Set position in local coordinate system
         * @zh 设置本地坐标
         * @param x X axis position
         * @param y Y axis position
         * @param z Z axis position
         */
        setPosition(x: number, y: number, z?: number): void;

...

@MrKylinGithub
Copy link
Contributor

谢谢反馈,已改。 正常的改法应该如下:

// 访问坐标
let pos = this.node.position;
// 修改 X 轴坐标
this.node.setPosition(200,pos.y,pos.z);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants