mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[threejs] Fixes #2108, create CanvasTexture for ImageBitmap.
This commit is contained in:
parent
787af434ff
commit
d9696997ac
@ -35,8 +35,10 @@ export class ThreeJsTexture extends Texture {
|
||||
|
||||
constructor (image: HTMLImageElement | ImageBitmap) {
|
||||
super(image);
|
||||
if (image instanceof ImageBitmap) throw new Error("ImageBitmap not supported.");
|
||||
this.texture = new THREE.Texture(image);
|
||||
if (image instanceof ImageBitmap)
|
||||
this.texture = new THREE.CanvasTexture(image);
|
||||
else
|
||||
this.texture = new THREE.Texture(image);
|
||||
this.texture.flipY = false;
|
||||
this.texture.needsUpdate = true;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user