AboutCanvas.java
上传用户:jinxueyang
上传日期:2016-05-15
资源大小:104k
文件大小:1k
- package game;
- import javax.microedition.lcdui.*;
- public class AboutCanvas extends Canvas
- {
- //声明Display对象
- Display display;
- //屏幕的宽度与高度
- private int scrWidth = 0;
- private int scrHeight = 0;
- private String name = "名称:ColorLinez";
- private String version = "版本:1.0";
- private String author = "作者:宋义";
- private String email = "Email:linkany@126.com";
-
- public AboutCanvas(Display display)
- {
- //获得Display对象
- this.display = display;
- //设屏全屏
- this.setFullScreenMode(true);
- //得到屏幕的宽度与高度
- scrWidth = this.getWidth();
- scrHeight = this.getHeight();
- }
-
- protected void paint(Graphics g)
- {
- //清屏
- g.setColor(0xFFFFFF);
- g.fillRect(0, 0, scrWidth, scrHeight);
- g.setColor(0x000000);
-
- g.drawString(name, 30, 30, Graphics.TOP | Graphics.LEFT);
- g.drawString(version, 30, 50, Graphics.TOP | Graphics.LEFT);
- g.drawString(author, 30, 70, Graphics.TOP | Graphics.LEFT);
- g.drawString(email, 30, 90, Graphics.TOP | Graphics.LEFT);
- g.drawString("按任意键返回", 50, 170, Graphics.TOP | Graphics.LEFT);
- }
-
- protected void keyPressed(int keyCode)
- {
- display.setCurrent(new MainMenuCanvas(display));
- }
- }