gui¶
rgb_to_hsv¶
float, float, float gui.rgb_to_hsv(float red, float green, float blue)
hsv_to_rgb¶
float, float, float gui.hsv_to_rgb(float hue, float saturation, float value)
get_window_size¶
float, float gui.get_window_size()
get_text_size¶
float, float gui.get_text_size(string text, float scale, float? wrap)
draw_line¶
void gui.draw_line(float x1, float y1, float x2, float y2, float red, float green, float blue, float alpha, float thickness)
Example Usage
-- draw two lines in the center of the window
local scale = 200.0
local window_w, window_h = gui.get_window_size()
gui.draw_line((window_w / 2.0) - (scale / 2.0), (window_h / 2.0) - (scale / 2.0), (window_w / 2.0) + (scale / 2.0), (window_h / 2.0) + (scale / 2.0), 0.0, 1.0, 0.0, 1.0, 2.0)
gui.draw_line((window_w / 2.0) - (scale / 2.0), (window_h / 2.0) + (scale / 2.0), (window_w / 2.0) + (scale / 2.0), (window_h / 2.0) - (scale / 2.0), 0.0, 1.0, 0.0, 1.0, 2.0)
Note
Coordinates must be within the game window's client area
draw_text¶
void gui.draw_text(string text, float x, float y, float red, float green, float blue, float alpha, float scale, float? wrap)
Example Usage
Note
Coordinates must be within the game window's client area
draw_rect¶
void gui.draw_rect(float x, float y, float width, float height, float red, float green, float blue, float alpha, float rounding, float thickness)
Example Usage
Note
Coordinates must be within the game window's client area
draw_rect_filled¶
void gui.draw_rect_filled(float x, float y, float width, float height, float red, float green, float blue, float alpha, float rounding)
Example Usage
Note
Coordinates must be within the game window's client area
draw_circle¶
void gui.draw_circle(float x, float y, float red, float green, float blue, float alpha, float radius, float thickness)
Example Usage
Note
Coordinates must be within the game window's client area
draw_circle_filled¶
void gui.draw_circle_filled(float x, float y, float red, float green, float blue, float alpha, float radius)
Example Usage
Note
Coordinates must be within the game window's client area
draw_triangle¶
void gui.draw_triangle(float x1, float y1, float x2, float y2, float x3, float y3, float red, float green, float blue, float alpha, float thickness)
Example Usage
-- draw a triangle in the center of the window
local scale = 200.0
local window_w, window_h = gui.get_window_size()
gui.draw_triangle((window_w / 2.0) - (scale / 2.0), (window_h / 2.0) + (scale / 2.0), (window_w / 2.0), (window_h / 2.0) - (scale / 2.0), (window_w / 2.0) + (scale / 2.0), (window_h / 2.0) + (scale / 2.0), 0.0, 1.0, 0.0, 1.0, 2.0)
Note
Coordinates must be within the game window's client area
draw_triangle_filled¶
void gui.draw_triangle_filled(float x1, float y1, float x2, float y2, float x3, float y3, float red, float green, float blue, float alpha)
Example Usage
-- draw a filled triangle in the center of the window
local scale = 200.0
local window_w, window_h = gui.get_window_size()
gui.draw_triangle_filled((window_w / 2.0) - (scale / 2.0), (window_h / 2.0) + (scale / 2.0), (window_w / 2.0), (window_h / 2.0) - (scale / 2.0), (window_w / 2.0) + (scale / 2.0), (window_h / 2.0) + (scale / 2.0), 0.0, 1.0, 0.0, 1.0)
Note
Coordinates must be within the game window's client area
draw_polygon¶
void gui.draw_polygon(float x, float y, float red, float green, float blue, float alpha, float radius, int segments, float thickness)
Example Usage
Note
Coordinates must be within the game window's client area
draw_polygon_filled¶
void gui.draw_polygon_filled(float x, float y, float red, float green, float blue, float alpha, float radius, int segments)
Example Usage
Note
Coordinates must be within the game window's client area