2D geometry rasterization primitives for terminal buffers.
Provides Bresenham line drawing, rectangles, midpoint circles/ellipses with
aspect ratio compensation, drop shadows, and scanline-filled triangles.
Class methods
circle(buffer :
UI::Buffer, cx :
Int32, cy :
Int32, radius :
Int32, char :
Char = '●', fg :
Color =
Color.none, bg :
Color =
Color.none, aspect_ratio :
Float64 = 2.0) :
Nil Sourcedraw_circle(buffer :
UI::Buffer, cx :
Int32, cy :
Int32, radius :
Int32, char :
Char = '●', fg :
Color =
Color.none, bg :
Color =
Color.none, aspect_ratio :
Float64 = 2.0) :
Nil Draws a circle using midpoint algorithm with terminal aspect ratio compensation
Sourcedraw_ellipse(buffer :
UI::Buffer, cx :
Int32, cy :
Int32, rx :
Int32, ry :
Int32, char :
Char = '●', fg :
Color =
Color.none, bg :
Color =
Color.none) :
Nil Draws an ellipse using the midpoint algorithm
Sourcedraw_grid(buffer :
UI::Buffer, x :
Int32, y :
Int32, width :
Int32, height :
Int32, interval_x :
Int32 = 8, interval_y :
Int32 = 4, offset_x :
Int32 = 0, offset_y :
Int32 = 0, style :
Symbol |
GridStylePreset |
GridGlyphs = :solid, fg :
Color =
Color.none, bg :
Color =
Color.none, intersection_fg :
Color |
Nil = nil, major_interval_x :
Int32 |
Nil = nil, major_interval_y :
Int32 |
Nil = nil, major_fg :
Color |
Nil = nil, show_horizontal :
Bool = true, show_vertical :
Bool = true) :
Nil Draws a 2D regular character grid inside the specified rectangle.
Sourcedraw_hline(buffer :
UI::Buffer, x :
Int32, y :
Int32, length :
Int32, char :
Char = '─', fg :
Color =
Color.none, bg :
Color =
Color.none, style :
Symbol = :solid) :
Nil Sourcedraw_line(buffer :
UI::Buffer, x0 :
Int32, y0 :
Int32, x1 :
Int32, y1 :
Int32, char :
Char = '─', fg :
Color =
Color.none, bg :
Color =
Color.none, style :
Symbol = :solid) :
Nil Draws a line between (x0, y0) and (x1, y1) using integer Bresenham algorithm.
Sourcedraw_rect(buffer :
UI::Buffer, x :
Int32, y :
Int32, width :
Int32, height :
Int32, border :
Symbol |
Border = :rounded, fg :
Color =
Color.none, bg :
Color =
Color.none) :
Nil Draws an outlined rectangle using border characters
Sourcedraw_shadow(buffer :
UI::Buffer, x :
Int32, y :
Int32, width :
Int32, height :
Int32, shadow_char :
Char = '░', fg :
Color =
Color.rgb(40, 40, 40)) :
Nil Draws a shaded drop shadow along the right and bottom sides of a box
Sourcedraw_triangle(buffer :
UI::Buffer, x0 :
Int32, y0 :
Int32, x1 :
Int32, y1 :
Int32, x2 :
Int32, y2 :
Int32, char :
Char = '*', fg :
Color =
Color.none, bg :
Color =
Color.none) :
Nil Draws a wireframe triangle
Sourcedraw_vline(buffer :
UI::Buffer, x :
Int32, y :
Int32, length :
Int32, char :
Char = '│', fg :
Color =
Color.none, bg :
Color =
Color.none, style :
Symbol = :solid) :
Nil Sourceellipse(buffer :
UI::Buffer, cx :
Int32, cy :
Int32, rx :
Int32, ry :
Int32, char :
Char = '●', fg :
Color =
Color.none, bg :
Color =
Color.none) :
Nil Sourcefill_circle(buffer :
UI::Buffer, cx :
Int32, cy :
Int32, radius :
Int32, char :
Char = '█', fg :
Color =
Color.none, bg :
Color =
Color.none, aspect_ratio :
Float64 = 2.0) :
Nil Sourcefill_rect(buffer :
UI::Buffer, x :
Int32, y :
Int32, width :
Int32, height :
Int32, char :
Char = ' ', fg :
Color =
Color.none, bg :
Color =
Color.none) :
Nil Fills a rectangle with character and styling
Sourcefill_triangle(buffer :
UI::Buffer, x0 :
Int32, y0 :
Int32, x1 :
Int32, y1 :
Int32, x2 :
Int32, y2 :
Int32, char :
Char = '█', fg :
Color =
Color.none, bg :
Color =
Color.none) :
Nil Scanline-fills a triangle
Sourcegrid(buffer :
UI::Buffer, x :
Int32, y :
Int32, width :
Int32, height :
Int32, interval_x :
Int32 = 8, interval_y :
Int32 = 4, offset_x :
Int32 = 0, offset_y :
Int32 = 0, style :
Symbol |
GridStylePreset |
GridGlyphs = :solid, fg :
Color =
Color.none, bg :
Color =
Color.none, intersection_fg :
Color |
Nil = nil, major_interval_x :
Int32 |
Nil = nil, major_interval_y :
Int32 |
Nil = nil, major_fg :
Color |
Nil = nil, show_horizontal :
Bool = true, show_vertical :
Bool = true) :
Nil Sourceline(buffer :
UI::Buffer, x0 :
Int32, y0 :
Int32, x1 :
Int32, y1 :
Int32, char :
Char = '─', fg :
Color =
Color.none, bg :
Color =
Color.none, style :
Symbol = :solid) :
Nil Convenience aliases for intuitive graphics scripting
Sourcerect(buffer :
UI::Buffer, x :
Int32, y :
Int32, width :
Int32, height :
Int32, border :
Symbol |
Border = :rounded, fg :
Color =
Color.none, bg :
Color =
Color.none) :
Nil Sourcerect_with_shadow(buffer :
UI::Buffer, x :
Int32, y :
Int32, width :
Int32, height :
Int32, border :
Symbol |
Border = :rounded, border_fg :
Color =
Color.none, shadow_char :
Char = '░', title :
String |
Nil = nil) :
Nil Source