Atlas Engine
API Referenceatlasatlas/units

Size2d

Width and height value with component-wise arithmetic returning new values.

Module: atlas/units

Width and height value with component-wise arithmetic returning new values.

Declaration

export class Size2d { ... }

Constructors

Creates a new size 2D.

constructor(width: number, height: number);

Properties

width

The width.

width: number;

height

The height.

height: number;

Methods

zero

Zero.

static zero(): Size2d;

toString

Returns a human-readable representation.

toString(): string;

add

Returns a new value by adding the operand component-wise; a numeric operand applies to every component.

add(other: Size2d | number): Size2d;

subtract

Returns a new value by subtracting the operand component-wise; a numeric operand applies to every component.

subtract(other: Size2d | number): Size2d;

multiply

Returns a new value by multiplying by the operand component-wise; a numeric operand applies to every component.

multiply(other: Size2d | number): Size2d;

divide

Returns a new value by dividing by the operand component-wise; a numeric operand applies to every component.

divide(other: Size2d | number): Size2d;

is

Tests exact equality of all components.

is(other: Size2d): boolean;

On this page