Size

Represents the width and height of an entity.

height number

The vertical size.

width number

The horizontal size.

Constructors

Size (width?: number, height?: number)

Creates a size instance with the specified parameters.

Parameters

width? number

The width value.

height? number

The height value.

Methods

clone

Creates a new instance with the same width and height.

Returns

Size - A new Size instance with the same dimensions.

equals

Compares this Size with another instance.

Parameters

other Size

The Size to compare with.

Returns

boolean true if the size members match. Otherwise, returns false.

getHeight

Gets the height value.

Returns

number - The current height value.

getWidth

Gets the width value.

Returns

number - The current width value.

setHeight

Sets the height to a new value.

Parameters

value number

The new height value.

Returns

Size - The current Size instance.

setWidth

Sets the width to a new value.

Parameters

value number

The new width value.

Returns

Size - The current Size instance.

create

Creates a Size instance with the specified parameters.

Parameters

width number

The width value.

height number

The height value.

Returns

Size - The new Size instance.

create

Creates a Size instance with the specified parameters.

Parameters

size number[] | Size

The size values as a [width, height] array or an existing instance.

Returns

Size - The newly created Size instance.

 /