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 Point instance.

Parameters:
  • vec2 (table) – A table with x and y coordinates. 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 to 2.

Returns:

A new instance of Point.

draw_all(...)

Draws all provided points. Each argument must be an instance of Point or a table of Point instances.

Parameters:

... – A variable number of Point instances or tables of Point instances.

Raises:

Raises an error if any argument is not a Point instance or a table of Point instances.

draw()

Draws the point at its specified position, size, and color using the fill_circle function.