API Referenceatlasatlas/graphics
Texture
GPU texture loaded from a resource or created procedurally.
Module: atlas/graphics
GPU texture loaded from a resource or created procedurally.
Declaration
export class Texture { ... }Properties
type
The category or discriminator for this value.
type: TextureType;resource
The resource backing this object.
resource: Resource;width
The width.
width: number;height
The height.
height: number;channels
The channels.
channels: number;id
The runtime identifier for this object.
id: number;borderColor
The border color.
borderColor: Color;Methods
fromResource
Creates a value from resource.
static fromResource(
resource: Resource | string,
type: TextureType,
): Texture;createEmpty
Creates empty.
static createEmpty(
width: number,
height: number,
type: TextureType,
borderColor?: Color,
): Texture;createColor
Creates color.
static createColor(
color: Color,
type: TextureType,
width: number,
height: number,
): Texture;createCheckerboard
Creates checkerboard.
createCheckerboard(
width: number,
height: number,
checkSize: number,
color1: Color,
color2: Color,
): void;createDoubleCheckerboard
Creates double checkerboard.
createDoubleCheckerboard(
width: number,
height: number,
checkSizeBig: number,
checkSizeSmall: number,
color1: Color,
color2: Color,
color3: Color,
): void;displayToWindow
Display to window.
displayToWindow(): void;