📄 myhelp.java
字号:
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import com.nokia.mid.ui.FullCanvas;
public class MyHelp extends FullCanvas
{
private Image back;
//帮助画面
private static Displayable instance;
//创建并得到一个帮助画面的对象
synchronized public static Displayable getInstance()
{
if(instance == null)
instance = new MyHelp();
return instance;
}
//帮助画面的构造方法,加入一个按钮
MyHelp()
{
super();
this.setFullScreenMode(true);
back = null;
try
{
back = Image.createImage("/res/back.png");
}
catch(Exception e)
{}
}
protected void keyPressed(int key)
{
if (key == -7)
{
GameMenu.flow("返回");
}
}
//在帮助画面上写上说明文字
protected void paint(Graphics g)
{
g.setColor(0,0,0);
g.fillRect(0,0,getWidth(),getHeight());
g.setColor(255,255,0);
g.setFont(Font.getFont(Font.FACE_PROPORTIONAL,Font.STYLE_PLAIN,Font.SIZE_SMALL));
g.drawImage(back,getWidth(),getHeight(),Graphics.BOTTOM|Graphics.RIGHT);
g.drawString("-游戏说明-",getWidth()/2-30,10,Graphics.TOP|Graphics.LEFT);
g.drawString("移动:",5,35,Graphics.TOP|Graphics.LEFT);
g.drawString("方向键 或 2,4,6,8",5,55,Graphics.TOP|Graphics.LEFT);
g.drawString("跳跃:",5,80,Graphics.TOP|Graphics.LEFT);
g.drawString("向上键 或 2",5,100,Graphics.TOP|Graphics.LEFT);
g.drawString("确定:",5,125,Graphics.TOP|Graphics.LEFT);
g.drawString("左功能键",5,145,Graphics.TOP|Graphics.LEFT);
g.drawString("返回:",5,170,Graphics.TOP|Graphics.LEFT);
g.drawString("右功能键",5,190,Graphics.TOP|Graphics.LEFT);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -