mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-01 13:19:08 +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) {
|
constructor (image: HTMLImageElement | ImageBitmap) {
|
||||||
super(image);
|
super(image);
|
||||||
if (image instanceof ImageBitmap) throw new Error("ImageBitmap not supported.");
|
if (image instanceof ImageBitmap)
|
||||||
this.texture = new THREE.Texture(image);
|
this.texture = new THREE.CanvasTexture(image);
|
||||||
|
else
|
||||||
|
this.texture = new THREE.Texture(image);
|
||||||
this.texture.flipY = false;
|
this.texture.flipY = false;
|
||||||
this.texture.needsUpdate = true;
|
this.texture.needsUpdate = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user