Class: Flonkerton::Window

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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.caption = CONFIG[:caption]
  load_resources
  create(initial_screen || default_screen)
end

Instance Attribute Details

#next_screenObject

Returns the value of attribute next_screen.



133
134
135
# File 'lib/flonkerton.rb', line 133

def next_screen
  @next_screen
end

#screenObject (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 button_down(id)
  @screen.button_down(id)
end

#button_up(id) ⇒ Object



155
156
157
# File 'lib/flonkerton.rb', line 155

def button_up(id)
  @screen.button_up(id)
end

#drawObject



147
148
149
# File 'lib/flonkerton.rb', line 147

def draw
  @screen.draw
end

#paramsObject



159
160
161
# File 'lib/flonkerton.rb', line 159

def params
  @params ||= Hash.new
end

#updateObject



142
143
144
145
# File 'lib/flonkerton.rb', line 142

def update
  @screen.update
  create(@next_screen) if @next_screen
end