📄 splash.java~54~
字号:
package genius.game.mobile.bachelor;
import javax.microedition.lcdui.*;
/**
* <p>Title: GENIUS bachelor</p>
* <p>Description: GENIUS Mobile Game - Bachelor</p>
* <p>Copyright: Copyright (c) 2002 GENIUS Tech.</p>
* <p>Company: GENIUS Technology Software Development Union.</p>
* @author Rodger hu
* @version 1.01
*/
public class splash extends Canvas implements CommandListener {
private gameTable gameTableInstance = new gameTable();
private Command cmdExit = new Command("退出", Command.EXIT, 0);
private Command cmdStart = new Command("开始", Command.OK, 1);
/**Construct the displayable*/
public splash() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
/**Component initialization*/
private void jbInit() throws Exception {
// set up this Displayable to listen to command events
setCommandListener(this);
// add the Exit command
addCommand(cmdExit);
addCommand(cmdStart);
}
/**Handle command events*/
public void commandAction(Command command, Displayable displayable) {
if (command == cmdExit)
{
// stop the MIDlet
mainGame.quitApp();
} else
{
Display.getDisplay(mainGame.instance).setCurrent(gameTableInstance);
}
}
/** Required paint implementation */
protected void paint(Graphics g) {
int x = g.getClipX();
int y = g.getClipY();
int w = g.getClipWidth();
int h = g.getClipHeight();
// Draw the frame
g.setColor(0xffffff);
g.fillRect(x, y, w, h);
try
{
Image img = Image.createImage("/geniussoftware_logo.png");
g.drawImage(img, 20, 20, Graphics.LEFT | Graphics.TOP);
} catch(java.io.IOException e)
{
e.printStackTrace();
}
g.setColor(255, 30, 10);
int n = g.getFont().stringWidth("基石科技软件开发联盟");
g.drawString("基石科技软件开发联盟", (w - n)/2, 90, Graphics.LEFT | Graphics.TOP);
Font f = Font.getFont(Font.FACE_MONOSPACE, Font.STYLE_PLAIN, Font.SIZE_SMALL);
g.setFont(f);
n = g.getFont().stringWidth("基石科技-天才游戏");
g.drawString("基石科技-天才游戏", (w - n)/2, 130, Graphics.LEFT | Graphics.TOP);
n = g.getFont().stringWidth("www.genius-software.com");
g.drawString("www.genius-software.com", (w - n)/2, 180, Graphics.LEFT | Graphics.TOP);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -