Point

A point on the screen

Constructor
Point(x: number = 0, y: number = 0)

Construct a Point from coordinates

Parameters
x The x coordinate
y The y coordinate
Constants

LEFT: number = 1

TOP: number = 2

RIGHT: number = 4

BOTTOM: number = 8

Static Methods
scale
static Point scale(x: number, y: number, edges: number = 0)

Scale the point from macro dimension to current device dimension. noScale is set to true. Use edges parameter to specify which edges the point will stick to after scaling

Cutout of the macro device and current device is taken into account. Refer to setMacroCutouts, setDeviceCutouts

Parameters
x The x coordinate of the top left point in macro dimension
y The y coordinate of the top left point in macro dimension
edges Edge of the screen to scale the point to. Possible values are Point.LEFT, Point.TOP, Point.RIGHT, Point.BOTTOM. Can be combined for example Point.LEFT + Point.TOP
Return
Point Scaled point in device dimension
Methods
getX
number getX()

Get the x coordinate

Return
number The x coordinate
getY
number getY()

Get the y coordinate

Return
number The y coordinate
offset
Point offset(dx: number, dy: number = 0, noScale: bool = false)

Offset the point's coordinate by dx and dy. Offset values are automatically scaled depend on the type of this Point. You can set the 3rd parameter to true to disable auto scaling.

Parameters
dx Offset amount in x axis
dy Offset amount in y axis
noScale true to disable auto scaling. Default: false
Return
Point The new offset Point instance
noScale
Point noScale()

After calling this, the system will not attempt to scale the point and just use the coordinate as it is

Return
Point This Point instance

© 2024 - Macrorify by KoK-CODE