Point
Preview noticeβ
The MatrixOS Python API is in preview and is subject to change; it may contain errors.
Overviewβ
The Point class represents 2D coordinates for LED positions and UI layouts. Points are used throughout the MatrixOS API for specifying positions on the 8x8 grid.
The Point class is implemented in Applications/Python/PikaPython/MatrixOS_Point.py with type hints in Applications/Python/PikaPython/_MatrixOS_Point.pyi.
Point(x, y)β
class Point:
def __init__(self, x: int, y: int) -> None
Creates a point at the specified coordinates.
Parameters:
x(int): X coordinate (0-7 for 8x8 grid)y(int): Y coordinate (0-7 for 8x8 grid)
Methodsβ
Xβ
def X() -> int
Gets the X coordinate of the point.
Returns:
int: The X coordinate value
Yβ
def Y() -> int
Gets the Y coordinate of the point.
Returns:
int: The Y coordinate value
SetXβ
def SetX(self, x: int) -> None
Sets the X coordinate of the point.
Parameters:
x(int): New X coordinate value
SetYβ
def SetY(self, y: int) -> None
Sets the Y coordinate of the point.
Parameters:
y(int): New Y coordinate value
Comments