Class: Stage
- Inherits:
-
Object
- Object
- Stage
- Defined in:
- lib/scrit/stage.rb
Instance Method Summary collapse
- #backdrops ⇒ Object
- #draw ⇒ Object
-
#initialize(window) ⇒ Stage
constructor
A new instance of Stage.
- #switch_backdrop_to(name) ⇒ Object
Constructor Details
#initialize(window) ⇒ Stage
Returns a new instance of Stage.
4 5 6 7 8 9 |
# File 'lib/scrit/stage.rb', line 4 def initialize(window) @window = window @backdrops = ["white"] @file = File.join(File.dirname(__FILE__), '..', 'backdrops', @backdrops[0] + ".png") @background_image = Gosu::Image.new(window, @file, true) end |
Instance Method Details
#backdrops ⇒ Object
16 17 18 |
# File 'lib/scrit/stage.rb', line 16 def backdrops @backdrops end |
#draw ⇒ Object
11 12 13 14 |
# File 'lib/scrit/stage.rb', line 11 def draw #@background_image.draw(0, 0, ZOrder::Background) @background_image.draw_as_quad(0, 0, 0xffffffff, @window.width, 0, 0xffffffff, @window.width, @window.height, 0xffffffff, 0, @window.height, 0xffffffff, 0) end |
#switch_backdrop_to(name) ⇒ Object
20 21 22 23 |
# File 'lib/scrit/stage.rb', line 20 def switch_backdrop_to(name) @file = File.join(File.dirname(__FILE__), '..', 'backdrops', name + ".png") @background_image = Gosu::Image.new(@window, @file, true) end |