Class: UI

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-ai/ui.rb

Overview

prints text on screen

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#textObject

Returns the value of attribute text.



4
5
6
# File 'lib/ruby-ai/ui.rb', line 4

def text
  @text
end

Instance Method Details

#drawObject



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