fivem-ts

a library to speed up the development of Fivem scripts and frameworks


Project maintained by Purpose-Dev Hosted on GitHub Pages — Theme by mattgraham

fivem-ts - Documentation v0.7.5Docs


fivem-ts - Documentation v0.7.5 / Client / Container

Class: Container

Represents a drawable container that can hold and manage other drawable items. The container has a position, size, and color, and it can draw itself and its child items on the screen.

Implements

Constructors

new Container()

new Container(pos, size, color): Container

Creates an instance of a Container.

Parameters

pos: Point

The position of the container on the screen.

size: Size

The size of the container.

color: Color

The color of the container.

Returns

Container

Defined in

client/ui/Container.ts:21

Properties

color

color: Color

Implementation of

IDrawable.color

Defined in

client/ui/Container.ts:11


items

items: IDrawable[] = []

Defined in

client/ui/Container.ts:12


pos

pos: Point

Implementation of

IDrawable.pos

Defined in

client/ui/Container.ts:9


size

size: Size

Implementation of

IDrawable.size

Defined in

client/ui/Container.ts:10

Methods

addItem()

addItem(item): void

Adds a single drawable item to the container.

Parameters

item: IDrawable

The drawable item to add.

Returns

void

Defined in

client/ui/Container.ts:33


addItems()

addItems(items): void

Adds multiple drawable items to the container.

Parameters

items: IDrawable[]

An array of drawable items to add.

Returns

void

Defined in

client/ui/Container.ts:42


draw()

draw(offset?, resolution?): void

Draws the container and its contained items on the screen.

Parameters

offset?: Size

An optional size offset to apply when drawing the container.

resolution?: Size

The resolution of the screen. Defaults to a new Size(0, 0) if not provided.

Returns

void

Implementation of

IDrawable.draw

Defined in

client/ui/Container.ts:52