Texture

Texture

A texture for the WebGL renderer. The texture holds an rgb asset loaded from a URL.

Methods

# destroy()

Textures create buffers on the graphics card. When you're done with a texture, you must explicitly destroy it to free these buffers. (It's not done automatically because pawns can share textures.)

# loadFromURL(url)

Load an image from an external asset. The load occurs dynamically and the texture will refresh when it's completed.

Parameters:
Name Type Description
url string
Example
import myImage from "./assets/image.jpg";
const myTexture.loadFromURL(myImage});