Class: Zgomot::UI::TextWindow

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/zgomot/ui/windows.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#set_color, #write

Constructor Details

#initialize(text, color, top, left) ⇒ TextWindow

Returns a new instance of TextWindow.



336
337
338
339
# File 'lib/zgomot/ui/windows.rb', line 336

def initialize(text, color, top, left)
  @color, @top, @left, @text = color, top, left, text
  display(text)
end

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



335
336
337
# File 'lib/zgomot/ui/windows.rb', line 335

def color
  @color
end

#leftObject (readonly)

Returns the value of attribute left.



335
336
337
# File 'lib/zgomot/ui/windows.rb', line 335

def left
  @left
end

#textObject (readonly)

Returns the value of attribute text.



335
336
337
# File 'lib/zgomot/ui/windows.rb', line 335

def text
  @text
end

#topObject (readonly)

Returns the value of attribute top.



335
336
337
# File 'lib/zgomot/ui/windows.rb', line 335

def top
  @top
end

Instance Method Details

#display(new_text = nil) ⇒ Object



340
341
342
343
344
345
# File 'lib/zgomot/ui/windows.rb', line 340

def display(new_text=nil)
  @text = new_text || text
  set_color(color) {
    write(top, left, text)
  }
end