示例#1
0
 public GameMenu(GameMain midlet_ /*,ConnectionServer conn_,RoleDataValue roleData_*/) {
   // true->使用GameAction(boolean suppressKeyEvents) , false->不使用GameAction(boolean
   // suppressKeyEvents)
   super(false);
   // 使用全螢幕
   setFullScreenMode(true);
   midlet = midlet_;
   // music = music_;
   // roleData = roleData_;
   display = midlet.getDisplay();
   layMa = new LayerManager();
   spInterface = new Sprite(createImage("/image/gameInterface/inface.png"), bgWidth, bgHeight);
   spName = new Sprite(createImage("/image/gameInterface/Title.png"), 84, 15);
   menustate = 0;
   menuNum = 3;
   // setFullScreenMode(true);
   g = getGraphics();
   /*if(!(getWidth()<176) || !(getHeight()<208)){
   	disWidth = (getWidth()-176)/2;//抓取螢幕的中心點
   	disHeight = (getHeight()-208)/2;//抓取螢幕的中心點
   }*/
   // 設定Sprite位置
   spName.setPosition(80, 20);
   spInterface.setPosition(0, 0);
   // 加入到LayerManager
   layMa.append(spName);
   spName.setVisible(false);
   layMa.append(spInterface);
   spInterface.setFrame(0);
   System.out.println("start");
   start();
 }
示例#2
0
 // 關閉程式
 public void exit() {
   drawDisplay();
   try {
     Thread.sleep(2000);
   } catch (Exception e) {
   }
   // backupmusic.stop();
   // backupmusic = null;
   midlet.exit();
 }