class
Opal::UI::Buffer
- Opal::UI::Buffer
- Reference
- Object
Overview
In-memory 2D grid of screen cells representing a terminal frame.
Defined in:
opal/ui/buffer.crConstructors
Instance Method Summary
-
#blit(src : Buffer, dst_x : Int32, dst_y : Int32, ignore_spaces : Bool = false) : Nil
Blits (copies) another buffer onto this buffer at the given coordinates.
- #cells : Array(Cell)
- #clear : Nil
- #clone : Buffer
-
#dim_all : Nil
Dims the entire buffer to create a backdrop effect.
-
#dim_rect(x : Int32, y : Int32, w : Int32, h : Int32) : Nil
Applies dimming attribute to all cells within the given rectangle.
- #fill(x : Int32, y : Int32, w : Int32, h : Int32, cell : Cell = Cell.empty) : Nil
- #get(x : Int32, y : Int32) : Cell
- #height : Int32
- #in_bounds?(x : Int32, y : Int32) : Bool
- #put_char(x : Int32, y : Int32, char : Char, fg : Color = Color.none, bg : Color = Color.none, bold : Bool = false, dim : Bool = false, italic : Bool = false, underline : Bool = false, reverse : Bool = false) : Nil
- #put_string(x : Int32, y : Int32, text : String, fg : Color = Color.none, bg : Color = Color.none, bold : Bool = false, dim : Bool = false, italic : Bool = false, underline : Bool = false, reverse : Bool = false, max_width : Int32 | Nil = nil) : Int32
-
#render_to_string(with_ansi : Bool = true) : String
Renders the buffer content to a string, optionally including ANSI color and style sequences.
- #set(x : Int32, y : Int32, cell : Cell) : Nil
-
#to_s(io : IO) : Nil
Appends a short String representation of this object which includes its class name and its object address.
- #width : Int32
Constructor Detail
Instance Method Detail
Blits (copies) another buffer onto this buffer at the given coordinates. If ignore_spaces is true, empty cells without background do not overwrite existing cells.
Applies dimming attribute to all cells within the given rectangle.
Renders the buffer content to a string, optionally including ANSI color and style sequences.
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>