Atlas Engine
API Referencegraphite

Image

Textured UI element with size, tint, and styling.

Module: graphite

Textured UI element with size, tint, and styling.

Declaration

export class Image extends UIObject { ... }

Extends: UIObject

Constructors

constructor();
constructor(
            texture: Texture,
            size: Size2d,
            position: Position2d,
            tint: Color,
        );

Properties

texture

texture: Texture;

position

position: Position3d;

size

size: Size2d;

tint

tint: Color;

Methods

getSize

Returns the current dimensions.

override getSize(): Size2d;

getScreenPosition

Returns the UI element's screen-space position.

override getScreenPosition(): Position2d;

setScreenPosition

Sets the UI element's screen-space position.

override setScreenPosition(position: Position2d): void;

style

Returns the element's style.

style(): UIStyle;

setStyle

Applies a style to the element.

setStyle(style: UIStyle): Image;

setTexture

setTexture(texture: Texture): void;

setSize

setSize(size: Size2d): void;

On this page