Raxol. Core. Box
(Raxol v2.6.0)
View Source
Box drawing utilities for Raxol.Core.Buffer.
Provides functions to draw boxes and fill areas on buffers.
Summary
Functions
Draw a box border on the buffer.
Draw a horizontal line.
Draw a vertical line.
Fill a rectangular area with a character.
Functions
Draw a box border on the buffer.
Parameters
- buffer: The buffer to draw on
- x: Left edge x coordinate
- y: Top edge y coordinate
- width: Box width (including borders)
- height: Box height (including borders)
- border_style: One of :single, :double, :rounded, :heavy, :dashed
Example
buffer = Buffer.create_blank_buffer(40, 10)
buffer = Box.draw_box(buffer, 0, 0, 40, 10, :double)
Draw a horizontal line.
Draw a vertical line.
Fill a rectangular area with a character.
Parameters
- buffer: The buffer to fill
- x: Left edge x coordinate
- y: Top edge y coordinate
- width: Area width
- height: Area height
- char: Character to fill with
- style: Style map for the fill character
Example
buffer = Box.fill_area(buffer, 1, 1, 10, 5, " ", %{bg_color: :blue})