?? rpgmidlet.java
字號:
import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class RPGMidlet extends MIDlet {
Display display;
static RPGMidlet instance = null;
RPGCanvas myCanvas;
ProgressThread gameLoading = null;
public RPGMidlet() {
super();
display = Display.getDisplay(this);
instance = this;
// myCanvas = new RPGCanvas(this);
gameLoading = new ProgressThread(this);
}
protected void startApp() throws MIDletStateChangeException {
// display.setCurrent(rcanvas);
if (gameLoading.loadProgressIsOver) {
display.setCurrent(myCanvas);
myCanvas.start();
} else {
display.setCurrent(gameLoading);
gameLoading.start();
if (gameLoading.gaugeCnt == 0) {
myCanvas = new RPGCanvas(this);
System.out.println("This is Done.");
}
}
}
protected void pauseApp() {
if (gameLoading.loadProgressIsOver) {
myCanvas.stop();
} else {
gameLoading.stop();
}
}
protected void destroyApp(boolean arg0) {
if (gameLoading.loadProgressIsOver)
//gameCanvas.record.close();
myCanvas.stop();
}
public void exitMIDlet() {
// destroyApp(false);
// notifyDestroyed();
instance.destroyApp(true);
instance.notifyDestroyed();
instance = null;
}
public RPGCanvas getCanvas() {
return myCanvas;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -