Skip to content

@jimka/typescript-ui / primitive / Point

Class: Point

Defined in: src/typescript/lib/primitive/Point.ts:10

Represents a two-dimensional point with x and y coordinates.

Extends

Constructors

new Point()

ts
new Point(x: number, y: number): Point

Defined in: src/typescript/lib/primitive/Point.ts:18

Parameters

x

number

The x coordinate.

y

number

The y coordinate.

Returns

Point

Overrides

BaseObject.constructor

Methods

getClassName()

ts
getClassName(): string

Defined in: src/typescript/lib/core/BaseObject.ts:44

Returns the runtime class name of this object.

Returns

string

The name of the constructor function as a string.

Inherited from

BaseObject.getClassName


getId()

ts
getId(): string

Defined in: src/typescript/lib/core/BaseObject.ts:24

Returns the unique identifier for this object.

Returns

string

The UUID string assigned at construction time.

Inherited from

BaseObject.getId


getX()

ts
getX(): number

Defined in: src/typescript/lib/primitive/Point.ts:31

Returns the x coordinate.

Returns

number

The x coordinate value, defaulting to 0 if unset.


getY()

ts
getY(): number

Defined in: src/typescript/lib/primitive/Point.ts:40

Returns the y coordinate.

Returns

number

The y coordinate value, defaulting to 0 if unset.


render()

ts
render(): string

Defined in: src/typescript/lib/primitive/Point.ts:49

Returns the point as a space-separated "x y" string.

Returns

string

A string of the form "<x> <y>".


setId()

ts
setId(id: string): this

Defined in: src/typescript/lib/core/BaseObject.ts:33

Sets the unique identifier for this object.

Parameters

id

string

The new identifier string to assign.

Returns

this

Inherited from

BaseObject.setId