feat: Image.from

This commit is contained in:
cha0s 2021-03-19 12:38:46 -05:00
parent 9262a38fd0
commit fde5a647ee

View File

@ -27,6 +27,14 @@ export class Image extends Resource {
}
}
static from(O) {
// eslint-disable-next-line global-require
const {Texture} = require('@pixi/core');
const image = new Image();
image.texture = Texture.from(O);
return image;
}
get height() {
return this.texture.height;
}