Class: GameWindow
- Inherits:
-
Gosu::Window
- Object
- Gosu::Window
- GameWindow
- Defined in:
- lib/misc/game_window.rb
Instance Attribute Summary collapse
-
#state ⇒ Object
Returns the value of attribute state.
Instance Method Summary collapse
- #button_down(id) ⇒ Object
- #draw ⇒ Object
-
#initialize ⇒ GameWindow
constructor
A new instance of GameWindow.
- #needs_cursor? ⇒ Boolean
- #needs_redraw? ⇒ Boolean
- #update ⇒ Object
Constructor Details
#initialize ⇒ GameWindow
Returns a new instance of GameWindow.
4 5 6 7 8 |
# File 'lib/misc/game_window.rb', line 4 def initialize super((ENV['w'] || 800).to_i, (ENV['h'] || 600).to_i, (ENV['fs'] ? true : false)) end |
Instance Attribute Details
#state ⇒ Object
Returns the value of attribute state.
2 3 4 |
# File 'lib/misc/game_window.rb', line 2 def state @state end |
Instance Method Details
#button_down(id) ⇒ Object
27 28 29 |
# File 'lib/misc/game_window.rb', line 27 def (id) @state.(id) end |
#draw ⇒ Object
15 16 17 |
# File 'lib/misc/game_window.rb', line 15 def draw @state.draw end |
#needs_cursor? ⇒ Boolean
23 24 25 |
# File 'lib/misc/game_window.rb', line 23 def needs_cursor? Utils.update_interval > 200 end |
#needs_redraw? ⇒ Boolean
19 20 21 |
# File 'lib/misc/game_window.rb', line 19 def needs_redraw? @state.needs_redraw? end |
#update ⇒ Object
10 11 12 13 |
# File 'lib/misc/game_window.rb', line 10 def update Utils.track_update_interval @state.update end |