getX
getX: (Point) -> numberThe x coordinate.
Point.new(…)
Perspective.localToCanvas(…)
Perspective.getCanvasTextLocation(…)| Method | Returns | Description |
|---|---|---|
getX() | number | The x coordinate. |
getY() | number | The y coordinate. |
distanceTo(Point) | number | The Euclidean distance to other, truncated to an int; the differences wrap as 32-bit integers. |
distance(Point) | number | (Point, Point) -> number: The Euclidean distance to pt, as a double (not truncated, unlike distanceTo). |
distance(number, number) | number | |
equals(any) | boolean | Whether obj is a Point with the same x and y; anything else is false. == is identity: the same object. |
new(number, number) | Point | (number, number) -> Point: The point x, y. |
new(Point) | Point | |
new() | Point |
| Field | Type | Description |
|---|---|---|
x | number | The x coordinate. |
y | number | The y coordinate. |
| Method | Returns | Description |
|---|---|---|
Actor.getCanvasImageLocation | Point? | The canvas point that centres image over the actor, zOffset up: its top-left corner, or nil when the point does not project. |
Actor.getCanvasSpriteLocation | Point? | The canvas point that centres sprite over the actor, zOffset up: its top-left corner, or nil when the point does not project. |
Actor.getCanvasTextLocation | Point? | The canvas point to draw text at, centred over the actor zOffset up: the anchor's x less half the text's width in the graphics' current… |
Actor.getCanvasTextLocationForWidth | Point? | The point getCanvasTextLocation(graphics, text, zOffset) gives, for text textWidth pixels wide, without a graphics (outside a render, o… |
Actor.getMinimapLocation | Point? | Where the actor is on the minimap, or nil when it is outside the minimap's radius or the minimap is hidden. |
AwtMouseEvent.getPoint | Point | The position on the canvas, as a Point. |
Client.getMouseCanvasPosition | Point | The cursor, canvas pixels. |
Component.getLocation | Point | The position in the parent, as a new Point. |
Container.getMousePosition | Point? | Where the pointer is, in this container's coordinates, while the container is showing under it, else nil. With allowChildren false, onl… |
GameObject.getSceneMaxLocation | Point | The scene tile of its north-east corner. |
GameObject.getSceneMinLocation | Point | The scene tile of its south-west corner. |
JList.indexToLocation | Point? | The origin of row index's cell, or nil outside the model. |
JShadowedLabel.getShadowSize | Point | The shadow's offset from the text, as a new Point (1, 1 unless set). |
JViewport.getViewPosition | Point | Where the view's top-left shows, in view coordinates. |
Overlay.getPreferredLocation | Point? | The preferred location, or nil: the very Point given to setPreferredLocation, until the user drags or resets the overlay; then the one… |
PerspectiveClass.getCanvasImageLocation | Point? | The top-left corner that centres image over the point, zOffset up. |
PerspectiveClass.getCanvasSpriteLocation | Point? | The top-left corner that centres sprite over the point, zOffset up. |
PerspectiveClass.getCanvasTextLocation | Point? | Where to draw text (its baseline's left end) so it is centred over the point, zOffset up, measured in graphics' font; nil for a `ni… |
PerspectiveClass.getCanvasTextMiniMapLocation | Point? | Where to draw text (its baseline's left end) so it is centred on the point's minimap position, measured in graphics' font; nil off th… |
PerspectiveClass.getMiniMapImageLocation | Point? | The top-left corner that centres image on the point's minimap position. |
PerspectiveClass.localToCanvas | Point? | (Client, LocalPoint, number) -> Point?: The canvas point of a ground point on plane, or nil behind the camera or outside the scene. |
PerspectiveClass.localToMinimap | Point? | (Client, LocalPoint) -> Point?: The canvas point of a local point on the minimap, or nil past the cut-off (20 tiles at the default zoom… |
PointClass.new | Point | (number, number) -> Point: The point x, y. |
Rectangle.getLocation | Point | The corner, as a new Point. |
Tile.getSceneLocation | Point | Its scene coordinates. |
TileObject.getCanvasLocation | Point? | (TileObject) -> Point?: Where its local centre projects onto the canvas, at its plane's ground height (`Perspective.localToCanvas(client,… |
TileObject.getCanvasTextLocation | Point? | The canvas point to draw text at, centred on the object's local location zOffset up (Perspective.getCanvasTextLocation: the anchor on… |
TileObject.getCanvasTextLocationForWidth | Point? | The point getCanvasTextLocation(graphics, text, zOffset) gives, for text textWidth pixels wide, without a graphics (outside a render, o… |
TileObject.getMinimapLocation | Point? | Where the object's local centre is on the minimap (Perspective.localToMinimap(client, getLocalLocation())), or nil past the minimap's r… |
Widget.getCanvasLocation | Point | Where the widget was last drawn on the canvas, as the client's draw loop records it ((-1, -1) before its first draw; a hidden widget keep… |
WidgetItem.getCanvasLocation | Point | The top-left corner of getCanvasBounds(). |
WorldMap.getWorldMapPosition | Point? | The world tile at the centre of the map, or nil before the world map has been opened this session (the client has no world map yet). |
WorldMap.worldPointToGraphicsPoint | Point? | The canvas point at the centre of worldPoint's tile on the open world map, or nil when the map is closed or its surface does not hold t… |
WorldMapPoint.getImagePoint | Point? | The pixel of the image drawn on the tile (nil: the image's centre). |
getXgetX: (Point) -> numberThe x coordinate.
getYgetY: (Point) -> numberThe y coordinate.
distanceTodistanceTo: (Point, Point) -> numberThe Euclidean distance to other, truncated to an int; the differences wrap as 32-bit integers.
distancedistance: ((Point, Point) -> number) & ((Point, number, number) -> number)(Point, Point) -> number: The Euclidean distance to pt, as a double (not truncated, unlike distanceTo).
(Point, number, number) -> number: The Euclidean distance to (px, py), as a double.
equalsequals: (Point, any) -> booleanWhether obj is a Point with the same x and y; anything else is false. == is identity: the same object.
newnew: ((number, number) -> Point) & ((Point) -> Point) & (() -> Point)(number, number) -> Point: The point x, y.
(Point) -> Point: A copy of p.
() -> Point: The origin, (0, 0).