Lipgloss::Canvas
Inherits Ultraviolet::Screen < Ultraviolet::Drawable < Reference < Object
Canvas is a cell-buffer that can be used to compose and draw Ultraviolet::Drawable objects like Layers.
Composed drawables are drawn onto the canvas in the order they were composed, meaning later drawables will appear "on top" of earlier ones.
A canvas can read, modify, and render its cell contents.
It implements Ultraviolet::Screen and Ultraviolet::Drawable.
Constructors
Instance methods
Returns the bounding rectangle of the canvas.
Returns the cell at position (x, y), or nil if out of bounds. Note: Unlike Go's *uv.Cell pointer, this returns a value type. Mutating the returned cell does not update the buffer. Use set_cell to modify the buffer. This is a known API difference from Go lipgloss.
Clear clears the canvas.
Composes a drawable onto the canvas.
Draws the canvas onto the given screen within the specified area.
Draws a string at position (x, y). This method is not part of the Go API but is used by Layer. It converts the string to Ultraviolet::Cell objects and sets them.
Returns the height of the canvas.
Renders the canvas into a styled string.
Sets the cell at position (x, y).
Returns the width of the canvas.
Returns the width calculation method used by the canvas.