Class: RubyFighter::Backdrop
- Inherits:
-
Gosu::Image
- Object
- Gosu::Image
- RubyFighter::Backdrop
- Defined in:
- lib/ruby_fighter/backdrop.rb
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(window, filename) ⇒ Backdrop
constructor
A new instance of Backdrop.
Constructor Details
#initialize(window, filename) ⇒ Backdrop
Returns a new instance of Backdrop.
5 6 7 8 9 10 |
# File 'lib/ruby_fighter/backdrop.rb', line 5 def initialize(window, filename) super(window, "assets/#{filename}", false) @scale = window.height / height @bg_x = -(width * @scale - window.width) / 2 end |
Instance Method Details
#draw ⇒ Object
12 13 14 |
# File 'lib/ruby_fighter/backdrop.rb', line 12 def draw super @bg_x, 0, 0, @scale, @scale end |