addPoint
addPoint: (Polygon, number, number) -> ()Append a point.
Polygon.new()
Perspective.getCanvasTilePoly(…)
Perspective.getCanvasTileAreaPoly(…)| Method | Returns | Description |
|---|---|---|
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 |
| Field | Type | Description |
|---|---|---|
npoints | number | How many points, AWT's field. |
| Method | Returns | Description |
|---|---|---|
Actor.getCanvasTilePoly | Polygon? | 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.getCanvasTileAreaPoly | Polygon? | (Client, LocalPoint, number) -> Polygon?: The outline of a size by size area centred on the point (a 3x3 area is size 3). |
PerspectiveClass.getCanvasTilePoly | Polygon? | (Client, LocalPoint) -> Polygon?: The tile's outline on the canvas (south-west, then clockwise), or nil when a corner does not project. |
PolygonClass.new | Polygon | () -> Polygon: An empty polygon. |
TileObject.getCanvasTilePoly | Polygon? | 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… |
addPointaddPoint: (Polygon, number, number) -> ()Append a point.
translatetranslate: (Polygon, number, number) -> ()Move every point.
resetreset: (Polygon) -> ()Remove every point.
copyXPointscopyXPoints: (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.
copyYPointscopyYPoints: (Polygon) -> {number}The y of each point (ypoints) as a new 1-based array.
newnew: (() -> Polygon) & (({number}, {number}, number) -> Polygon)() -> Polygon: An empty polygon.
({number}, {number}, number) -> Polygon: The polygon of the first npoints points.