Class: GGLib::StateObject
- Inherits:
-
Object
- Object
- GGLib::StateObject
- Defined in:
- lib/state.rb
Overview
A StaticScreen is a menu. It suspends the game and redirects all input to itself. StaticScreen is typically used through derivation, although it can be used otherwise. StaticScreen#start suspends the game and starts the menu. StaticScreen#end returns to the game.
Direct Known Subclasses
Instance Method Summary collapse
-
#button_down(id) ⇒ Object
Equivalent to Gosu::Window#button_down.
-
#button_up(id) ⇒ Object
Equivalent to Gosu::Window#button_down.
-
#draw ⇒ Object
Equivalent to Gosu::Window#draw.
-
#end ⇒ Object
Return control to the GameWindow.
-
#onEnd ⇒ Object
This method is called when the static screen is uninitialized.
-
#onStart ⇒ Object
This method is called when the static screen is initialized.
- #onTerminate ⇒ Object
-
#start ⇒ Object
Begin rerouting input to the static screen.
-
#update ⇒ Object
Equivalent to Gosu::Window#update.
-
#window ⇒ Object
Returns a reference to the window to which the static screen is associated.
Instance Method Details
#button_down(id) ⇒ Object
Equivalent to Gosu::Window#button_down
24 25 26 |
# File 'lib/state.rb', line 24 def (id) #do nothing by default end |
#button_up(id) ⇒ Object
Equivalent to Gosu::Window#button_down
28 29 30 |
# File 'lib/state.rb', line 28 def (id) #do nothing by default end |
#draw ⇒ Object
Equivalent to Gosu::Window#draw
49 50 |
# File 'lib/state.rb', line 49 def draw end |
#end ⇒ Object
Return control to the GameWindow. DO NOT OVERRIDE THIS METHOD.
15 16 17 18 19 20 21 22 |
# File 'lib/state.rb', line 15 def end onEnd $window.deleteAllWidgets $window.createWidgets $window.deleteAllImages $window.cursor.unforceVisible onTerminate end |
#onEnd ⇒ Object
This method is called when the static screen is uninitialized. It is ment to be overridden in derived classes. This is a good place to preform tasks such as stopping audio. Widgets are automatically destroyed on exit by the base class StaticScreen
44 45 |
# File 'lib/state.rb', line 44 def onEnd end |
#onStart ⇒ Object
This method is called when the static screen is initialized. It is ment to be overridden in derived classes. This is a good place to preform tasks such as creating widgets.
40 41 |
# File 'lib/state.rb', line 40 def onStart end |
#onTerminate ⇒ Object
46 47 |
# File 'lib/state.rb', line 46 def onTerminate end |
#start ⇒ Object
Begin rerouting input to the static screen. DO NOT OVERRIDE THIS METHOD.
9 10 11 12 13 |
# File 'lib/state.rb', line 9 def start $window.deleteAllImages $window.cursor.forceVisible onStart end |
#update ⇒ Object
Equivalent to Gosu::Window#update
32 33 |
# File 'lib/state.rb', line 32 def update end |
#window ⇒ Object
Returns a reference to the window to which the static screen is associated.
35 36 37 |
# File 'lib/state.rb', line 35 def window return $window end |