Polygon

Extends
Shape
Methods
6
Fields
1

Getting one

Polygon.new()
Perspective.getCanvasTilePoly(…)
Perspective.getCanvasTileAreaPoly(…)

Methods

MethodReturnsDescription
addPoint(number, number)()Append a point.
translate(number, number)()Move every point.
reset()()Remove every point.
copyXPoints(){number}The x of each point (xpoints) as a new 1-based array, so a write to it changes nothing. addPoint/translate change the polygon.
copyYPoints(){number}The y of each point (ypoints) as a new 1-based array.
new()Polygon() -> Polygon: An empty polygon.
new({number}, {number}, number)Polygon

Fields

FieldTypeDescription
npointsnumberHow many points, AWT's field.

Returned by

MethodReturnsDescription
Actor.getCanvasTilePolyPolygon?The canvas polygon of the tile under the actor's local location (one tile; an NPC answers its whole size), or nil when a corner does no…
PerspectiveClass.getCanvasTileAreaPolyPolygon?(Client, LocalPoint, number) -> Polygon?: The outline of a size by size area centred on the point (a 3x3 area is size 3).
PerspectiveClass.getCanvasTilePolyPolygon?(Client, LocalPoint) -> Polygon?: The tile's outline on the canvas (south-west, then clockwise), or nil when a corner does not project.
PolygonClass.newPolygon() -> Polygon: An empty polygon.
TileObject.getCanvasTilePolyPolygon?The outline of the tiles it stands on, on the canvas (a game object's whole footprint, sizeX by sizeY; one tile for the rest), as `Pers…

Method details

copyXPoints

copyXPoints: (Polygon) -> {number}

The x of each point (xpoints) as a new 1-based array, so a write to it changes nothing. addPoint/translate change the polygon.

copyYPoints

copyYPoints: (Polygon) -> {number}

The y of each point (ypoints) as a new 1-based array.

new

new: (() -> Polygon) & (({number}, {number}, number) -> Polygon)

() -> Polygon: An empty polygon.

({number}, {number}, number) -> Polygon: The polygon of the first npoints points.