Class: OrangeZest::Window

Inherits:
Gosu::Window
  • Object
show all
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

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

.currentObject



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 button_down(id)
  super
  Input.button_down(id)
end

#drawObject



23
24
25
26
# File 'lib/orange_zest/window.rb', line 23

def draw
  super
  Group::Main.draw
end

#updateObject



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