posted 11 years ago
Hi,
I was trying to load an image and print it out on the screen, but for some reason it does not seem to appear. The path is correct (the file is in a res folder), but even with an image that is elsewhere on my computer with the correct file path it still does not work.
Game.java
Screen.java
Background.java
Thanks!
Also, another question I have, is how would I define the drawImage function in the background class, so that in the screen.paintComponent method I just have to call background.paint(g) and it prints it out on the screen?
Something like this:
and then I just have to call player.paint(g) in screen.paintComponent method
but instead with an image like so:
but that does not work because "The method drawImage(Image, int, int, ImageObserver) in the type Graphics is not applicable for the arguments (Image, int, int, Background)"