API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classTexture
A static GPU texture sourced from an image, canvas, or video element. Holds the pixel source, its sampling state (ScaleModes, WrapModes) and its upload state (mip generation, alpha premultiplication). A `version` counter is incremented on every mutation that invalidates the GPU copy, so backends detect stale uploads without polling. Static helpers Texture.black, Texture.white, and Texture.empty provide ready-made placeholder textures. Default sampler options are configurable via Texture.defaultOptions.
import { Texture } from '@codexo/exojs'A static GPU texture sourced from an image, canvas, or video element.
Holds the pixel source, its sampling state (ScaleModes, WrapModes) and its upload state (mip generation, alpha premultiplication). A `version` counter is incremented on every mutation that invalidates the GPU copy, so backends detect stale uploads without polling.
Static helpers Texture.black, Texture.white, and Texture.empty provide ready-made placeholder textures. Default sampler options are configurable via Texture.defaultOptions.
new(source: TextureSourceAnything the rendering pipeline can sample as a texture source: a loaded image, a canvas of either kind, a playing video, a decoded bitmap, a decoded video fra…, options?: Partial<TextureOptionsFull construction options of a texture: sampling state plus upload state.>): TextureaddDestroyListener(listener: () => void): thisdestroy(): voidremoveDestroyListener(listener: () => void): thissetGenerateMipMap(generateMipMap: boolean): thissetPremultiplyAlpha(premultiplyAlpha: boolean): thissetSize(width: number, height: number): thisupdateSource(): thisfromColor(color: Color32-bit RGBA color value with channel-wise accessors. Red, green, and blue are integers in 0..255; alpha is a float in 0..1. Out-of-range values are saturated o… | string, size: number): Textureempty: Texturedestroyed: booleanerror: Error | nullflipY: booleangenerateMipMap: booleanheight: numberloaded: Promise<this>powerOfTwo: booleanpremultiplyAlpha: booleanready: booleanversion: numberwidth: numberblack: Texturemissing: Texturewhite: Texture