axis
options
shape
vizlib.colors
vizlib.default_color
vizlib.select_color()
vizlib.random_color()
vizlib.erase_shape(shape)
vizlib.draw_point(pos, options)
vizlib.draw_circle(pos, radius, axis, options)
vizlib.draw_sphere(pos, radius, options)
vizlib.draw_line(pos1, pos2, options)
vizlib.draw_square(pos, radius, axis, options)
vizlib.draw_cube(pos, radius, options)
vizlib.draw_area(pos1, pos2, options)
A string consisting of either "x", "y" or "z". Required by certain drawing functions. Must be lower case.
A table of values used to set shape options when passed to a drawing function. All values are optional.
Values
color
- String. The color of the shape. Defaults tovizlib.default_color
.infinite
- Boolean. If true, the shape will never expire. By default the shape will expire after 10 seconds.player
- String or player object. If set, only the specified player will see the shape.
A table of values defining a created shape. Returned from all drawing functions.
Values
name
- String. The player name, if a player was specified upon creation.expiry
- The time this shape will expire, if not infinite. Can be compared toos.time()
.ids
- Table. The IDs for the particle spawners this shape is made of.
Provides a list of 24 colors, sorted by hue. Each value is a table containing two values:
name
- The name of the color, in lowercase.hex
- The RGB hex code for the color, including the#
prefix.
The default color for shapes if no color is specified upon creation.
Value is set by the vizlib_default_color
setting.
Selects a random color from vizlib.colors
.
Returns
- A hex color code, including the
#
prefix.
Generates a completely random color.
Returns
- A hex color code, including the
#
prefix.
Removes a shape from the world.
Useful for removing shapes created with options.infinite = true
.
Arguments
shape
- The shape to be removed.
Draws a point (one slightly bigger particle).
Arguments
pos
- Vector. The position of the point.options
- Table. Seeoptions
above.
Draws an approximate circle on a particular axis.
Arguments
pos
- Vector. The position of the center of the circle.radius
- Number. The radius of the circle.axis
- String. Seeaxis
above. The axis the circle will be positioned perpendicular to.options
- Table. Seeoptions
above.
Draws an approximate sphere.
Arguments
pos
- Vector. The position of the center of the sphere.radius
- Number. The radius of the sphere.options
- Table. Seeoptions
above.
Draws a line from pos1
to pos2
.
Arguments
pos1
- Vector. The starting point of the line.pos2
- Vector. The ending point of the line.options
- Table. Seeoptions
above.
Draws a square on a particular axis.
Arguments
pos
- Vector. The position of the center of the square.radius
- Number. The distance from the center to the edge of the square.axis
- String. Seeaxis
above. The axis the square will be positioned perpendicular to.options
- Table. Seeoptions
above.
Draws a cube.
Arguments
pos
- Vector. The position of the center of the cube.radius
- Number. The distance from the center to the side of the cube.options
- Table. Seeoptions
above.
Draws a rectangular cuboid between pos1
and pos2
.
Arguments
pos1
- Vector. The first corner of the area.pos2
- Vector. The second corner of the area.options
- Table. Seeoptions
above.