Drawing Functions
This article is an overview of drawing related functions. ENIGMA provides all the same functions as Game Maker for rendering but also implements its own. For example, advanced curve functions can be found below as well. There is information on 3d functions and 3D graphics.
There are also drawing functions with the following Resource Functions.
General
- draw_clear
- draw_clear_alpha
- draw_get_alpha
- draw_get_alpha_test
- draw_get_alpha_test_ref_value
- draw_get_color
- draw_getpixel
- draw_getpixel_ext
- draw_healthbar
- draw_highscore
- draw_set_alpha
- draw_set_alpha_test
- draw_set_alpha_test_ref_value
- draw_set_blend_mode
- draw_set_blend_mode_ext
- draw_set_color
- draw_set_color_rgb
- draw_set_color_rgba
- draw_set_color_write_enable
- draw_set_halign
- draw_set_valign
- draw_path
- draw_enable_alphablend
- draw_enable_drawevent
- color_get_red
- color_get_blue
- color_get_green
- color_get_hue
- color_get_saturation
- color_get_value
- merge_color
- make_color_hsv
- make_color_rgb
Basic Shapes
- draw_point
- draw_point_color
- draw_line
- draw_line_width
- draw_line_color
- draw_line_width_color
- draw_rectangle
- draw_rectangle_angle
- draw_rectangle_color
- draw_circle
- draw_circle_color
- draw_circle_perfect
- draw_circle_color_perfect
- draw_ellipse
- draw_ellipse_color
- draw_ellipse_perfect
- draw_triangle
- draw_triangle_color
- draw_roundrect
- draw_roundrect_color
- draw_arrow
- draw_button
- draw_mandelbrot
Curves
ENIGMA has some great curve drawing functions. It can draw both Bézier curves, as well as cubic Hermite splines. The major difference between them is that splines will go through the points. Bézier curves will interpolate between them and usually don't go through them.
Notice: Most of these modes are not very useful in drawing curves. It is recommended just to use pr_linestrip. Pattern can be added to curves with draw_set_line_pattern function.
Mode | Result Description |
---|---|
pr_pointlist | Stipples a spline curve. Dots are not evenly spaced; tighter curves will be described by more dots. |
pr_linelist | Draws a dashed spline curve. This is an unintended behavior, and so dashes are not evenly spaced. |
pr_linestrip | Draws an unfilled, regular curve. |
pr_trianglelist | This behavior is nonstandard. Depending on the slope of your curve, you will have dashes or triangles vaguely following a curve pattern. |
pr_trianglestrip | Equally useful as pr_trianglestrip, this will produce a curve with thickness varying with the jerk of the curve (the geometric mean of ddx/i and ddy/y). |
pr_trianglefan | Draws the curve, filling it back to the first point. |