Module: GosuWindowAPI
- Included in:
- HookedGosuWindow, MockGosuWindow
- Defined in:
- lib/gamebox/core/hooked_gosu_window.rb
Constant Summary collapse
- MAX_UPDATE_SIZE_IN_MILLIS =
500
Instance Attribute Summary collapse
-
#needs_cursor ⇒ Object
(also: #needs_cursor?)
Returns the value of attribute needs_cursor.
Instance Method Summary collapse
-
#button_down(id) ⇒ Object
in gosu this captures mouse and keyboard events.
- #button_up(id) ⇒ Object
- #draw ⇒ Object
- #initialize(width, height, fullscreen) ⇒ Object
- #update ⇒ Object
Instance Attribute Details
#needs_cursor ⇒ Object Also known as: needs_cursor?
Returns the value of attribute needs_cursor.
35 36 37 |
# File 'lib/gamebox/core/hooked_gosu_window.rb', line 35 def needs_cursor @needs_cursor end |
Instance Method Details
#button_down(id) ⇒ Object
in gosu this captures mouse and keyboard events
27 28 29 |
# File 'lib/gamebox/core/hooked_gosu_window.rb', line 27 def (id) fire :button_down, id end |
#button_up(id) ⇒ Object
31 32 33 |
# File 'lib/gamebox/core/hooked_gosu_window.rb', line 31 def (id) fire :button_up, id end |
#draw ⇒ Object
22 23 24 |
# File 'lib/gamebox/core/hooked_gosu_window.rb', line 22 def draw fire :draw end |
#initialize(width, height, fullscreen) ⇒ Object
3 4 5 |
# File 'lib/gamebox/core/hooked_gosu_window.rb', line 3 def initialize(width, height, fullscreen) super(width, height, fullscreen) end |
#update ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/gamebox/core/hooked_gosu_window.rb', line 7 def update millis = Gosu::milliseconds # ignore the first update if @last_millis delta = millis delta -= @last_millis if millis > @last_millis delta = MAX_UPDATE_SIZE_IN_MILLIS if delta > MAX_UPDATE_SIZE_IN_MILLIS fire :update, delta end @last_millis = millis end |