TUI::Painter
Inherits Reference < Object
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
Constructors
new(w, h)
Sourcenew(wh : Tuple(Int32, Int32))
SourceInstance methods
[](i, j) : Cell
Source[]=(i, j, val : Cell)
Source[]?(i, j) : Cell | Nil
Sourcecentre(j, str)
SourceTODO: do not set negative coordinate values
clear(rect) : self
Sourceclear
Sourcediff(old : Array(Array(Cell)) | Nil = nil, &) : Bool
Sourceeach
Sourceeach_index
Sourceeach_with_index
SourceDraws 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_x, new_y, new_w = Int32::MAX, new_h = Int32::MAX) : self
Push new offsets onto stack
Optional arguments can set a maximum width
resize(w, h) : self
Sourcesurface
Sourceto_s(io : IO)
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>