getX
getX: (WorldArea) -> numberThe western-most x.
WorldArea.new(…)
player:tile():toWorldArea()
client:createMenuEntry(…):getActor():getWorldArea()| Method | Returns | Description |
|---|---|---|
getX() | number | The western-most x. |
getY() | number | The southern-most y. |
getWidth() | number | Width in tiles. |
getHeight() | number | Height in tiles. |
getPlane() | number | The plane. |
contains(WorldPoint) | boolean | Whether the tile is in the area, on its plane. |
contains2D(WorldPoint) | boolean | Whether the tile is in the area, whatever its plane. |
distanceTo(WorldArea) | number | (WorldArea, WorldArea) -> number: The shortest Chebyshev distance to other, or 2147483647 across planes. |
distanceTo(WorldPoint) | number | |
distanceTo2D(WorldArea) | number | (WorldArea, WorldArea) -> number: The shortest Chebyshev distance to other, ignoring planes. |
distanceTo2D(WorldPoint) | number | |
isInMeleeDistance(WorldArea) | boolean | (WorldArea, WorldArea) -> boolean: Whether other touches this area's edge from outside, cardinally (a diagonal neighbour is not in mele… |
isInMeleeDistance(WorldPoint) | boolean | |
intersectsWith(WorldArea) | boolean | Whether the areas share a tile, on the same plane. |
toWorldPoint() | WorldPoint | The south-west corner. |
toWorldPointList() | {WorldPoint} | Every tile, column by column (x outer, y inner), as a 1-based array. |
hasLineOfSightTo(WorldView, WorldArea) | boolean | (WorldArea, WorldView, WorldArea) -> boolean: Whether some edge tile of this area sees some edge tile of other across wv's line-of-si… |
hasLineOfSightTo(WorldView, WorldPoint) | boolean | |
canTravelInDirection(WorldView, number, number) | boolean | (WorldArea, WorldView, number, number) -> boolean: Whether the whole area can step one tile in the direction of dx, dy (each taken by… |
canTravelInDirection(WorldView, number, number, (WorldPoint) -> boolean) | boolean | |
new(number, number, number, number, number) | WorldArea | (number, number, number, number, number) -> WorldArea: The area width by height from the south-west corner x, y. |
new(WorldPoint, number, number) | WorldArea |
| Method | Returns | Description |
|---|---|---|
Actor.getWorldArea | WorldArea | The world area the actor covers: its world location and size (an NPC's composition size, 1 for a player). |
WorldAreaClass.new | WorldArea | (number, number, number, number, number) -> WorldArea: The area width by height from the south-west corner x, y. |
WorldPoint.toWorldArea | WorldArea | The 1x1 area of this tile. |
getXgetX: (WorldArea) -> numberThe western-most x.
getYgetY: (WorldArea) -> numberThe southern-most y.
getWidthgetWidth: (WorldArea) -> numberWidth in tiles.
getHeightgetHeight: (WorldArea) -> numberHeight in tiles.
getPlanegetPlane: (WorldArea) -> numberThe plane.
containscontains: (WorldArea, WorldPoint) -> booleanWhether the tile is in the area, on its plane.
contains2Dcontains2D: (WorldArea, WorldPoint) -> booleanWhether the tile is in the area, whatever its plane.
distanceTodistanceTo: ((WorldArea, WorldArea) -> number) & ((WorldArea, WorldPoint) -> number)(WorldArea, WorldArea) -> number: The shortest Chebyshev distance to other, or 2147483647 across planes.
(WorldArea, WorldPoint) -> number: The shortest Chebyshev distance to the tile, or 2147483647 across planes.
distanceTo2DdistanceTo2D: ((WorldArea, WorldArea) -> number) & ((WorldArea, WorldPoint) -> number)(WorldArea, WorldArea) -> number: The shortest Chebyshev distance to other, ignoring planes.
(WorldArea, WorldPoint) -> number: The shortest Chebyshev distance to the tile, ignoring planes.
isInMeleeDistanceisInMeleeDistance: ((WorldArea, WorldArea) -> boolean) & ((WorldArea, WorldPoint) -> boolean)(WorldArea, WorldArea) -> boolean: Whether other touches this area's edge from outside, cardinally (a diagonal neighbour is not in melee distance).
(WorldArea, WorldPoint) -> boolean: Whether the tile touches this area's edge from outside, cardinally.
intersectsWithintersectsWith: (WorldArea, WorldArea) -> booleanWhether the areas share a tile, on the same plane.
toWorldPointtoWorldPoint: (WorldArea) -> WorldPointThe south-west corner.
toWorldPointListtoWorldPointList: (WorldArea) -> {WorldPoint}Every tile, column by column (x outer, y inner), as a 1-based array.
hasLineOfSightTohasLineOfSightTo: ((WorldArea, WorldView, WorldArea) -> boolean) & ((WorldArea, WorldView, WorldPoint) -> boolean)(WorldArea, WorldView, WorldArea) -> boolean: Whether some edge tile of this area sees some edge tile of other across wv's line-of-sight collision flags. false across planes, off wv's plane, or where an end tile is outside the scene or has no tile; an area never sees one it overlaps. Not necessarily symmetric.
(WorldArea, WorldView, WorldPoint) -> boolean: hasLineOfSightTo(wv, other:toWorldArea()): whether this area sees the tile.
canTravelInDirectioncanTravelInDirection: ((WorldArea, WorldView, number, number) -> boolean) & ((WorldArea, WorldView, number, number, (WorldPoint) -> boolean) -> boolean)(WorldArea, WorldView, number, number) -> boolean: Whether the whole area can step one tile in the direction of dx, dy (each taken by its sign) under wv's movement collision flags. Other actors are not obstacles. Raises NullPointerException when the area's corner is outside the scene, and ArrayIndexOutOfBoundsException when the step leaves the collision map.
(WorldArea, WorldView, number, number, (WorldPoint) -> boolean) -> boolean: As canTravelInDirection(wv, dx, dy), also refusing the tiles extraCondition(tile) answers false for (an NPC's actor collision, say). It is asked tile by tile as the walk goes (the x edge, the y edge, then the diagonal), stopping at the first refusal, and must return a boolean; an error it raises ends the walk and is raised from this call unchanged.
newnew: ((number, number, number, number, number) -> WorldArea) & ((WorldPoint, number, number) -> WorldArea)(number, number, number, number, number) -> WorldArea: The area width by height from the south-west corner x, y.
(WorldPoint, number, number) -> WorldArea: The area width by height from the south-west corner location, on its plane.