HelpCanvas.java
上传用户:jinxueyang
上传日期:2016-05-15
资源大小:104k
文件大小:1k
- package game;
- import javax.microedition.lcdui.*;
- public class HelpCanvas extends Canvas
- {
- //声明Display对象
- Display display;
- //屏幕的宽度与高度
- private int scrWidth = 0;
- private int scrHeight = 0;
-
- private Image image = null;
- //private String content = "ColorLinez是一款由玩家通过功能键移动各色小球,把五个及五个以上相同颜色小球移成一横排、一竖列,小球从而消失的游戏,玩家每移动一个小球,就会随机新出现三个随机颜色的小球,小球消失的数量作为玩家得到的分数!";
- public HelpCanvas(Display display)
- {
- //获得Display对象
- this.display = display;
- //设屏全屏
- this.setFullScreenMode(true);
- //得到屏幕的宽度与高度
- scrWidth = this.getWidth();
- scrHeight = this.getHeight();
-
- try
- {
- image = Image.createImage("/res/help.png");
- }
- catch(Exception e)
- {
- System.out.println(e);
- }
- }
-
- protected void paint(Graphics g)
- {
- //清屏
- g.setColor(0xFFFFFF);
- g.fillRect(0, 0, scrWidth, scrHeight);
- g.setColor(0x000000);
-
- g.drawImage(image, 0, 0, Graphics.TOP | Graphics.LEFT);
- }
-
- protected void keyPressed(int keyCode)
- {
- image = null;
- display.setCurrent(new MainMenuCanvas(display));
- }
- }