Class: Background
- Inherits:
-
Object
- Object
- Background
- Defined in:
- lib/lib/user_interface/background.rb
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize ⇒ Background
constructor
A new instance of Background.
Constructor Details
#initialize ⇒ Background
Returns a new instance of Background.
4 5 6 7 |
# File 'lib/lib/user_interface/background.rb', line 4 def initialize() dir_path = File.dirname(__FILE__) @image = Gosu::Image.new(dir_path + '/../../media/square.png') end |
Instance Method Details
#draw ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/lib/user_interface/background.rb', line 9 def draw @image.draw(0, 0, ZBACKGROUND, scale_x = MAPX, scale_y = MAPY, color = Gosu::Color::CYAN) # sky @image.draw(0, WINDOW_HEIGHT - GRASS_THICKNESS * TILESIZE, ZBACKGROUND, scale_x = MAPX, scale_y = GRASS_THICKNESS, color = Gosu::Color::GREEN) # grass end |