Point
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)
Example:
# Create a point at coordinates (3, 4)
point = Point(3, 4)
print(f"Point: ({point.X()}, {point.Y()})")
Methods
X
def X() -> int
Gets the X coordinate of the point.
Returns:
int
: The X coordinate value
Example:
point = Point(3, 4)
x_coord = point.X() # Returns 3