Class: Flonkerton::Window
- Inherits:
-
Gosu::Window
- Object
- Gosu::Window
- Flonkerton::Window
- Defined in:
- lib/flonkerton.rb
Instance Attribute Summary collapse
-
#next_screen ⇒ Object
Returns the value of attribute next_screen.
-
#screen ⇒ Object
readonly
Returns the value of attribute screen.
Instance Method Summary collapse
- #button_down(id) ⇒ Object
- #button_up(id) ⇒ Object
- #draw ⇒ Object
-
#initialize(initial_screen = nil) ⇒ Window
constructor
A new instance of Window.
- #params ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(initial_screen = nil) ⇒ Window
Returns a new instance of Window.
135 136 137 138 139 140 |
# File 'lib/flonkerton.rb', line 135 def initialize initial_screen = nil super(CONFIG[:width], CONFIG[:height], CONFIG[:fullscreen]) self. = CONFIG[:caption] load_resources create(initial_screen || default_screen) end |
Instance Attribute Details
#next_screen ⇒ Object
Returns the value of attribute next_screen.
133 134 135 |
# File 'lib/flonkerton.rb', line 133 def next_screen @next_screen end |
#screen ⇒ Object (readonly)
Returns the value of attribute screen.
132 133 134 |
# File 'lib/flonkerton.rb', line 132 def screen @screen end |
Instance Method Details
#button_down(id) ⇒ Object
151 152 153 |
# File 'lib/flonkerton.rb', line 151 def (id) @screen.(id) end |
#button_up(id) ⇒ Object
155 156 157 |
# File 'lib/flonkerton.rb', line 155 def (id) @screen.(id) end |
#draw ⇒ Object
147 148 149 |
# File 'lib/flonkerton.rb', line 147 def draw @screen.draw end |
#params ⇒ Object
159 160 161 |
# File 'lib/flonkerton.rb', line 159 def params @params ||= Hash.new end |
#update ⇒ Object
142 143 144 145 |
# File 'lib/flonkerton.rb', line 142 def update @screen.update create(@next_screen) if @next_screen end |