I have an Image displayStartText
and originalStartText
initialized thusly:
Image originalStartText = new ImageIcon(getClass().getClassLoader().getResource( "GAME/resources/ready_set_fight.gif" )).getImage();
Image displayStartText = originalStartText;
I try to draw displayStartText centered in my background with:
g2d.drawImage( displayStartText, (int)((bgDispWidth-displayStartText.getWidth())/2), (int)((bgDispHeight-displayStartText.getHeight())/2), null );
But a compiler error that I don't understand shows up
Gameplay.java:694: error: method getWidth in class Image cannot be applied to given types;
g2d.drawImage( displayStartText, (int)((bgDispWidth-displayStartText.getWidth())/2), (int)((bgDispHeight-displayStartText.getHeight())/2), null );
^
required: ImageObserver
found: no arguments
reason: actual and formal argument lists differ in length
Any insights on why I might run into this issue?