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

[runtimes] [spine-ts] [spine-threejs] ImageBitmap not supported in ThreeJsTexture #2108

Closed
mrzlxa opened this issue Jul 11, 2022 · 3 comments
Labels

Comments

@mrzlxa
Copy link

mrzlxa commented Jul 11, 2022

Was trying to create my own ThreeJsTexture. Faced an error, because of a check in constructor.

export class ThreeJsTexture extends Texture {
    constructor(image) {
        super(image);


// SUPPOSEDLY WRONG CHECK?
        if (image instanceof ImageBitmap)
            throw new Error("ImageBitmap not supported.");
// !SUPPOSEDLY WRONG CHECK?


        this.texture = new THREE.Texture(image);
        this.texture.flipY = false;
        this.texture.needsUpdate = true;
        }
}

Thought this change is weird, found a commit with it here
e4372e5

This introduced "TS strict mode" which should not probably lead to this change.

Does this check have to be there?

Also, given ImageBitmap is supported in AssetManagerBase.js (link to loadTexture() method) this looks suspiciously wrong.

Thanks!

@badlogic badlogic added the bug label Jul 13, 2022
@dan-playboomsports
Copy link

We're also currently seeing this issue as well. It's breaking our apps on iOS 14. Is there any update or status on a fix for this bug?

@badlogic
Copy link
Collaborator

badlogic commented Aug 5, 2022

This has been resolved and the fix is in both the 4.1 and 4.2-beta branch. You can update to spine-threejs 4.1.20 via NPM (or 4.2.5 for the 4.2-beta branch).

@mrzlxa
Copy link
Author

mrzlxa commented Aug 17, 2022

Awesome! thanks!

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

No branches or pull requests

3 participants