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

Creates a new image.

constructor();

Creates a new image.

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

Properties

texture

The texture used for rendering.

texture: Texture;

position

The position in world space.

position: Position3d;

size

The dimensions.

size: Size2d;

tint

The 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

Sets texture.

setTexture(texture: Texture): void;

setSize

Sets size.

setSize(size: Size2d): void;

On this page