Load images or textures from external URLs.
Important methods:
import { ImageReference, serializable } from '@needle-tools/engine';export class MyComponent extends Behaviour { @serializable(ImageReference) myImage?:ImageReference; async start() { if(this.myImage) { const texture = await this.myImage.createTexture(); if(texture) { // use the texture } } } Copy
import { ImageReference, serializable } from '@needle-tools/engine';export class MyComponent extends Behaviour { @serializable(ImageReference) myImage?:ImageReference; async start() { if(this.myImage) { const texture = await this.myImage.createTexture(); if(texture) { // use the texture } } }
Loads the bitmap data of the image
Static
Load images or textures from external URLs.
Important methods:
Example
Related: