API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classTexture

@codexo/exojs / rendering / stable

A static GPU texture sourced from an image, canvas, or video element. Holds the pixel source and sampling parameters (ScaleModes, WrapModes, mip generation, alpha premultiplication). A `version` counter is incremented on every mutation so backends can detect stale GPU uploads without polling. Static helpers Texture.black, Texture.white, and Texture.empty provide ready-made placeholder textures. Default sampler options are configurable via Texture.defaultSamplerOptions.

15
props
9
methods
0
events
Import
import { Texture } from '@codexo/exojs'

A static GPU texture sourced from an image, canvas, or video element.

Holds the pixel source and sampling parameters (ScaleModes, WrapModes, mip generation, alpha premultiplication). A `version` counter is incremented on every mutation so backends can detect stale GPU uploads without polling.

Static helpers Texture.black, Texture.white, and Texture.empty provide ready-made placeholder textures. Default sampler options are configurable via Texture.defaultSamplerOptions.

Constructors 1
new(source: TextureSource, options?: Partial<SamplerOptions>): Texture
Methods 9
addDestroyListener(listener: object): this
destroy(): void
removeDestroyListener(listener: object): this
setPremultiplyAlpha(premultiplyAlpha: boolean): this
setScaleMode(scaleMode: ScaleModes): this
setSize(width: number, height: number): this
setSource(source: TextureSource): this
setWrapMode(wrapMode: WrapModes): this
updateSource(): this
Properties 15
defaultSamplerOptions: SamplerOptions
empty: Texture
flipY: boolean
generateMipMap: boolean
height: number
powerOfTwo: boolean
premultiplyAlpha: boolean
scaleMode: ScaleModes
size: Size
source: TextureSource
version: number
width: number
wrapMode: WrapModes
black: Texture
white: Texture
Source