Class: Window

Inherits:
Gosu::Window
  • Object
show all
Defined in:
lib/window.rb

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Window

Returns a new instance of Window.



2
3
4
5
6
# File 'lib/window.rb', line 2

def initialize(name)
  super(*Processor::Screen)
  self.caption = "Blast Mavens: Multiplayer Beta v0.1.0"
  set_delegate(name)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object



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

def method_missing(sym, *args, &block)
  @delegate.send(sym, *args, &block)
end

Instance Method Details

#button_down(id) ⇒ Object



16
17
18
# File 'lib/window.rb', line 16

def button_down(id)
  @delegate.button_down(id)
end

#drawObject



8
9
10
# File 'lib/window.rb', line 8

def draw
  @delegate.draw
end

#set_delegate(name, opts = {}) ⇒ Object



20
21
22
# File 'lib/window.rb', line 20

def set_delegate(name, opts={})
  @delegate = Object.const_get(name).new(self, opts)
end

#updateObject



12
13
14
# File 'lib/window.rb', line 12

def update
  @delegate.update
end