Class: UI
- Inherits:
-
Object
- Object
- UI
- Defined in:
- lib/ruby-ai/ui.rb
Overview
prints text on screen
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(window) ⇒ UI
constructor
A new instance of UI.
Constructor Details
#initialize(window) ⇒ UI
Returns a new instance of UI.
6 7 8 9 10 11 |
# File 'lib/ruby-ai/ui.rb', line 6 def initialize(window) @font = Gosu::Font.new(window, Gosu::default_font_name, 15) @text = 'Press <enter> to begin.' @width = window.width @height = window.height end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
4 5 6 |
# File 'lib/ruby-ai/ui.rb', line 4 def text @text end |
Instance Method Details
#draw ⇒ Object
13 14 15 |
# File 'lib/ruby-ai/ui.rb', line 13 def draw @font.draw_rel(@text, @width / 2, @height - 20, 3, 0.5, 0.0, 1.0, 1.0, 0xffffff00) end |