Class: OrangeZest::Window
- Inherits:
-
Gosu::Window
- Object
- Gosu::Window
- OrangeZest::Window
- Defined in:
- lib/orange_zest/window.rb
Overview
A subclass of Gosu::Window which overrides a variety of default methods in order to:
-
Draw and update the main group
-
Update and provide inputs to Input
Class Method Summary collapse
Instance Method Summary collapse
- #button_down(id) ⇒ Object
- #draw ⇒ Object
-
#initialize(*args) ⇒ Window
constructor
A new instance of Window.
- #update ⇒ Object
Constructor Details
#initialize(*args) ⇒ Window
Returns a new instance of Window.
10 11 12 13 14 |
# File 'lib/orange_zest/window.rb', line 10 def initialize(*args) super(*args) raise "OrangeZest only supports one window" if defined? @@current @@current = self end |
Class Method Details
.current ⇒ Object
6 7 8 |
# File 'lib/orange_zest/window.rb', line 6 def self.current @@current end |
Instance Method Details
#button_down(id) ⇒ Object
28 29 30 31 |
# File 'lib/orange_zest/window.rb', line 28 def (id) super Input.(id) end |
#draw ⇒ Object
23 24 25 26 |
# File 'lib/orange_zest/window.rb', line 23 def draw super Group::Main.draw end |
#update ⇒ Object
16 17 18 19 20 21 |
# File 'lib/orange_zest/window.rb', line 16 def update super Input.update(self) Scheduler.update Group::Main.update end |