def initialize
super 200, 135, false
self.caption = "Gosu Cycle Example"
@shape_x = 0
# Create and load an image to display
@background_image = Gosu::Image.new("media/earth.png") #this is causing the error
# Create and load a font for drawing text on the screen
@font = Gosu::Font.new(20)
@cycle = 0
puts "0. In initialize\n"
end
I keep getting an error with the background image initialization. It keeps giving an error where it can't find the file specified. The image is in a folder called 'media' which is in the folder for the program.
I had a similar issue with the 'require' but fixed it with 'require_relative'. I cannot find such a solution for this issue.
You must give absolute Path:
The above example is for a Mac.