feat: Image.from
This commit is contained in:
parent
9262a38fd0
commit
fde5a647ee
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user