class TUI::Painter
- TUI::Painter
- Reference
- Object
Overview
Created by the application, passed down the widget tree by using #push
to alter relative coordinates
When drawing use #w
and #h
for actual size
Use #pop
after drawing
Defined in:
tui/painter.crConstructors
Instance Method Summary
- #[](i, j) : Cell
-
#[]=(i, j, width, str : String)
Draw a string
str
- #[]=(i, j, val : Cell)
- #[]=(i, j, val : Char)
-
#[]=(i, j, str : String)
Draw a string
str
- #[]?(i, j) : Cell | Nil
- #centre(mid, j, str : String)
- #centre(j, str)
-
#circle(x0 : Int32, y0 : Int32, radius : Int32 = 5, ch : Char = '█', debug = false)
TODO do not set negative coordinate values
- #clear(rect) : self
- #clear : self
- #diff(old : Array(Array(Cell)) | Nil = nil, &) : Bool
- #each(&)
- #each_index(&)
- #each_with_index(&)
- #h : Int32
- #hline(x0 : Int32, y0 : Int32, len : Int32, ch : Char = '█', debug = false) : self
- #line(x0 : Int32, y0 : Int32, x1 : Int32, y1 : Int32, ch : Char = '█', debug = false) : self
-
#poly(x_points : Array(Int32), y_points : Array(Int32), ch : Char = '█', debug = false) : self
Draws a polygon with points specified in separate arrays of x and y coordinates
-
#poly(points : Array(Tuple(Int32, Int32)), ch : Char = '█', debug = false) : self
Draws a polygon with points specified as an array of coordinate tuples
-
#pop : self
Pop offsets from stack
- #print(i, j, str : String)
-
#push(new_x, new_y, new_w = Int32::MAX, new_h = Int32::MAX) : self
Push new offsets onto stack
- #rect(x0 : Int32, y0 : Int32, x1 : Int32, y1 : Int32, ch : Char = '█', debug = false) : self
- #resize(w, h) : self
- #surface : Array(Array(Cell))
-
#to_s(io : IO)
Appends a short String representation of this object which includes its class name and its object address.
- #vline(x0 : Int32, y0 : Int32, len : Int32, ch : Char = '█', debug = false) : self
- #w : Int32
Constructor Detail
Instance Method Detail
TODO do not set negative coordinate values
Draws a polygon with points specified in separate arrays of x and y coordinates
Draws a polygon with points specified as an array of coordinate tuples
Push new offsets onto stack
Optional arguments can set a maximum width
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>