struct

Tui::Rect

Inherits Struct / Value / Object

Constructors

new(x : Int32 = 0, y : Int32 = 0, width : Int32 = 0, height : Int32 = 0)
Source
zero
Source

Instance methods

==(other : Rect) : Bool

Check equality

Source
bottom

Bottom edge (exclusive)

Source
contains?(px : Int32, py : Int32) : Bool

Check if point is inside rectangle

Source
each_cell

Iterate over all cells in rectangle

Source
empty?

Check if rectangle is empty

Source
expand(amount : Int32) : Rect

Create expanded copy

Source
height
Source
height=(height : Int32)
Source
inset(top : Int32, right : Int32, bottom : Int32, left : Int32) : Rect
Source
inset(amount : Int32) : Rect

Create inset copy (shrink by amount)

Source
intersect(other : Rect) : Rect | Nil

Intersect with another rectangle

Source
offset(dx : Int32, dy : Int32) : Rect

Create offset copy

Source
right

Right edge (exclusive)

Source
to_s(io : IO) : Nil

Same as #inspect(io).

Source
union(other : Rect) : Rect

Union with another rectangle

Source
width
Source
width=(width : Int32)
Source
x=(x : Int32)
Source
y=(y : Int32)
Source