Skip to content

Vertexes

The Vertexes class stores polygon vertex data used by the renderer.


Methods

constructor(array?: Vertex[])Vertexes

Creates a new Vertexes instance.

  • arrayVertex[] (optional) - The array.

Returned:


Push(vert: Vertex)this

Pushes the push.

Returned:

  • this - The current instance for chaining.

Pop()this

Pops the pop.

Returned:

  • this - The current instance for chaining.

Set(index: number, vert: Vertex)void

Sets the set.

  • indexnumber - The index.
  • vertVertex - The vert.

Get(index: number)Vertex

Retrieves the get.

  • indexnumber - The index.

Returned:


Length()number

Provides access to length.

Returned:

  • number - The result of the call.

Reserve(newSize: number)this

Provides access to reserve.

  • newSizenumber - The new size.

Returned:

  • this - The current instance for chaining.

PushCircle(centerX: number, centerY: number, radius: number, startAngle?: number, endAngle?: number, segmentCount?: number)this

Pushes the circle.

  • centerXnumber - The center x.
  • centerYnumber - The center y.
  • radiusnumber - The radius.
  • startAnglenumber (optional) - 0
  • endAnglenumber (optional) - 360
  • segmentCountnumber (optional) - 20

Returned:

  • this - The current instance for chaining.

PushRoundRect(x: number, y: number, w: number, h: number, roundSize: number, segmentCount: number)this

Pushes the round rect.

  • xnumber - The x coordinate.
  • ynumber - The y coordinate.
  • wnumber - The w.
  • hnumber - The h.
  • roundSizenumber - corner rounding size in pixels, does not change the width and height
  • segmentCountnumber - The segment count.

Returned:

  • this - The current instance for chaining.

PushRect(x: number, y: number, w: number, h: number)this

Pushes the rect.

  • xnumber - The x coordinate.
  • ynumber - The y coordinate.
  • wnumber - The w.
  • hnumber - The h.

Returned:

  • this - The current instance for chaining.

ScaleUV(valX: number, valY: number)this

Provides access to scale uv.

  • valXnumber - The val x.
  • valYnumber - The val y.

Returned:

  • this - The current instance for chaining.