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 / Rectangle

Class: Rectangle

Represents a rectangle that can be drawn on the screen.

Implements

Constructors

new Rectangle()

new Rectangle(pos, size, color): Rectangle

Creates a new Rectangle instance.

Parameters

pos: Point

The position of the rectangle.

size: Size

The size of the rectangle.

color: Color

The color of the rectangle.

Returns

Rectangle

Defined in

client/ui/Rectangle.ts:15

Properties

color

color: Color

The color of the rectangle.

Implementation of

IDrawable.color

Defined in

client/ui/Rectangle.ts:18


pos

pos: Point

The position of the rectangle.

Implementation of

IDrawable.pos

Defined in

client/ui/Rectangle.ts:16


size

size: Size

The size of the rectangle.

Implementation of

IDrawable.size

Defined in

client/ui/Rectangle.ts:17

Methods

draw()

Internal draw function that handles the logic for drawing the rectangle.

Param

Either an offset size or a position point.

Param

The size to draw the rectangle with.

Param

The color to draw the rectangle with.

Param

An optional size specifying the resolution.

draw(offset, resolution)

draw(offset?, resolution?): void

Draws the rectangle on the screen.

Parameters

offset?: Size

An optional size specifying an offset to use when drawing.

resolution?: Size

An optional size specifying the resolution.

Returns

void

Param

Either an offset size or a position point.

Param

The size to draw the rectangle with.

Param

The color to draw the rectangle with.

Param

An optional size specifying the resolution.

Implementation of

IDrawable.draw

Defined in

client/ui/Rectangle.ts:27

draw(pos, size, color, resolution)

draw(pos, size, color, resolution?): void

Draws the rectangle on the screen with the specified position, size, and color.

Parameters

pos: Point

The position to draw the rectangle at.

size: Size

The size to draw the rectangle with.

color: Color

The color to draw the rectangle with.

resolution?: Size

An optional size specifying the resolution.

Returns

void

Param

Either an offset size or a position point.

Param

The size to draw the rectangle with.

Param

The color to draw the rectangle with.

Param

An optional size specifying the resolution.

Implementation of

IDrawable.draw

Defined in

client/ui/Rectangle.ts:37