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

相机渲染到RenderTexutre后,设置为SpriteFrame的texture,在web和native上方向相反 #17647

Open
dum3ng opened this issue Sep 18, 2024 · 0 comments
Labels
Bug Needs Triage Needs to be assigned by the team

Comments

@dum3ng
Copy link

dum3ng commented Sep 18, 2024

Cocos Creator version

3.8.2

System information

mac sonoma, chrome, ios 12

Issue description

将一个相机的targetTexture设置为RenderTexture,然后再设置为SpriteFrame的texutre,结果在web和ios上方向是相反的。

        const rt = new RenderTexture()
        rt.initialize({ width: 300, height: 200 })
        this.offlineCamera.targetTexture = rt

        const sp = this.getComponent(Sprite)
        const frame = new SpriteFrame()
        frame.texture = this.offlineCamera.targetTexture
        frame.flipUVY = true  // 为了让在浏览器上是正向的
        sp.spriteFrame = frame
cocoscreator编辑中: 浏览器上: ios simulator中:
image

Relevant error log output

No response

Steps to reproduce

如问题描述。

Minimal reproduction project

No response

@dum3ng dum3ng added Bug Needs Triage Needs to be assigned by the team labels Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Needs to be assigned by the team
Projects
None yet
Development

No branches or pull requests

1 participant