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