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
permalink #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.caption = CONFIG[:caption] load_resources create(initial_screen || default_screen) end |
Instance Attribute Details
permalink #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 |
permalink #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
permalink #button_down(id) ⇒ Object
[View source]
151 152 153 |
# File 'lib/flonkerton.rb', line 151 def (id) @screen.(id) end |
permalink #button_up(id) ⇒ Object
[View source]
155 156 157 |
# File 'lib/flonkerton.rb', line 155 def (id) @screen.(id) end |
permalink #draw ⇒ Object
[View source]
147 148 149 |
# File 'lib/flonkerton.rb', line 147 def draw @screen.draw end |
permalink #params ⇒ Object
[View source]
159 160 161 |
# File 'lib/flonkerton.rb', line 159 def params @params ||= Hash.new end |
permalink #update ⇒ Object
[View source]
142 143 144 145 |
# File 'lib/flonkerton.rb', line 142 def update @screen.update create(@next_screen) if @next_screen end |