I am trying to paint the whole of the screen to create a game.
Below is the source code of two classes which i am trying to do this with. But for some reason it is not painting the whole screen
Thankyou for your help.
import java.io.PrintStream;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
public class SpeedingRacer extends MIDlet {
public Display display;
private GameCanvas gameCanvas;
public SpeedingRacer() {
display = Display.getDisplay(this);
gameCanvas = new GameCanvas(this);
}
protected void startApp(){
display.setCurrent(gameCanvas);
}
protected void pauseApp(){
}
protected void destroyApp(boolean unconditional){
}
} // SpeedingRacer
public class GameCanvas extends FullCanvas {
private SpeedingRacer speedingRacer;
public GameCanvas(SpeedingRacer speedingRacer) {
this.speedingRacer = speedingRacer;
}
protected void paint(Graphics g){
g.setColor(85,251,251);
g.fillRect(0,0,getWidth(),getHeight());
}
} // GameCanvas
Thankyou

Reply With Quote

