Point¶
The Point class provides functionalities for creating and drawing points.
- class Point¶
This class represents a point with a position, color, and size.
- new(vec2, color, size)¶
Creates a new
Pointinstance.- Parameters:
vec2 (
table) – A table withxandycoordinates. Defaults to{x = 0, y = 0}.color (
table) – A table representing the color with four values (r, g, b, a). Defaults to{1, 1, 1, 1}.size (
number) – The size of the point. Defaults to2.
- Returns:
A new instance of
Point.
- draw_all(...)¶
Draws all provided points. Each argument must be an instance of
Pointor a table ofPointinstances.- Parameters:
... – A variable number of
Pointinstances or tables ofPointinstances.- Raises:
Raises an error if any argument is not a
Pointinstance or a table ofPointinstances.
- draw()¶
Draws the point at its specified position, size, and color using the
fill_circlefunction.