Class: Flonkerton::Screen

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

Overview

This class shouldn’t be instantiated, it provides behavior for subclasses.

Direct Known Subclasses

WelcomeScreen

Instance Method Summary collapse

Constructor Details

#initialize(game) ⇒ Screen

Returns a new instance of Screen.



184
185
186
187
# File 'lib/flonkerton.rb', line 184

def initialize game
  @game = game
  setup
end

Instance Method Details

#button_down(id) ⇒ Object



192
193
194
# File 'lib/flonkerton.rb', line 192

def button_down(id)
  close if id == Gosu::KbEscape # Don't Panic!
end

#button_down?(id) ⇒ Boolean

Returns:

  • (Boolean)


215
216
217
# File 'lib/flonkerton.rb', line 215

def button_down?(id)
  @game.button_down?(id)
end

#button_up(id) ⇒ Object



190
# File 'lib/flonkerton.rb', line 190

def button_up(id); end

#clip_to(x, y, w, h, &block) ⇒ Object



231
232
233
# File 'lib/flonkerton.rb', line 231

def clip_to(x, y, w, h, &block)
  @game.clip_to(x, y, w, h, &block)
end

#closeObject



219
220
221
# File 'lib/flonkerton.rb', line 219

def close
  @game.close
end

#drawObject



197
# File 'lib/flonkerton.rb', line 197

def draw; end

#go_to(screen) ⇒ Object



223
224
225
# File 'lib/flonkerton.rb', line 223

def go_to(screen)
  @game.next_screen = screen
end

#heightObject



203
204
205
# File 'lib/flonkerton.rb', line 203

def height
  @game.height
end

#mouse_xObject



207
208
209
# File 'lib/flonkerton.rb', line 207

def mouse_x
  @game.mouse_x
end

#mouse_yObject



211
212
213
# File 'lib/flonkerton.rb', line 211

def mouse_y
  @game.mouse_y
end

#paramsObject



227
228
229
# File 'lib/flonkerton.rb', line 227

def params
  @game.params
end

#setupObject



189
# File 'lib/flonkerton.rb', line 189

def setup; end

#updateObject



196
# File 'lib/flonkerton.rb', line 196

def update; end

#widthObject



199
200
201
# File 'lib/flonkerton.rb', line 199

def width
  @game.width
end