?? gameinterface.java
字號:
package com.j2medev.chapter5;
/**
* GameInterface.java
*
* Created on 2006年3月6日, 下午4:38
* @author 孫宇哲
* 一些常用數據包括屏幕大小、機型鍵位、資源路徑、字體高度等
*
* NOKIA :NOKIA_S60_V1、 NOKIA_S60_V2、NOKIA_S40_V1、NOKIA_S40_V2
* MOTO :MOTO_V600、MOTO_E398、MOTO_C650、MOTO_V878
* SAMSUNG:SAMSUNG_D508、SAMSUNG_E108
* SONYERICSSON:SE_K700、SE_K500
*
* 更新日期 2006-3-26
* 增加上、下、左、右、選擇鍵的鍵值
*
* 更新moto機型的鍵值,將v600 ,e398資源路徑分離
*
* 更新日期 2006-3-27
* 修復MOTO V600 鍵值bug 將MOTO v600 ,e398宏定義完全分離
*
* 更新日期 2006-4-24
* 修復s40_v1版本中選Fire鍵鍵值bug
* 更新日期 2006-5-5
* 增加SE_S700,MOTO_E680兩個240*320屏幕的機型
*/
import javax.microedition.lcdui.*;
public interface GameInterface {
//#if ( NOKIA_S60_V1 || NOKIA_S60_V2)
/** Mobile Screen Width(手機屏幕的寬度) */
public static final int SCREEN_WIDTH=176;
/** Mobile Screen Height(手機屏幕的高度)*/
public static final int SCREEN_HEIGHT=208;
/** Mobile softkey left (手機左軟鍵鍵值)*/
public static final byte SOFT_KEY_LEFT = -6;
/** Mobile softkey right (手機右軟鍵鍵值)*/
public static final byte SOFT_KEY_RIGHT = -7;
/** Mobile Key Up (手機方向鍵上)*/
public static final byte KEY_UP = -1;
/** Mobile Key Down (手機方向鍵下)*/
public static final byte KEY_DOWN = -2;
/** Mobile Key LEFT (手機方向鍵左)*/
public static final byte KEY_LEFT = -3;
/** Mobile Key RIGHT (手機方向鍵右)*/
public static final byte KEY_RIGHT = -4;
/** Mobile Key FIRE (手機選擇鍵)*/
public static final byte KEY_FIRE = -5;
//#if NOKIA_S60_V1
/** Resource Path (資源路徑 位于src/RES_PATH ) */
public static final String RES_PATH="/res/NOKIA_S60_V1/";
//#else
//# /** Resource Path (資源路徑 位于src/RES_PATH ) */
//# public static final String RES_PATH="/res/NOKIA_S60_V2/";
//#endif
/** Font Height (字體高度) */
public static final int FONT_HEIGHT =20;
/** Font Height (字體寬度) */
public static final int FONT_WIDTH = 16;
/**FONT_SYSTEM 系統默認字體 */
public static final Font FONT_SYSTEM=Font.getFont(Font.STYLE_PLAIN, Font.FACE_SYSTEM, Font.SIZE_SMALL);
//#elif MOTO_V600
//# /** Mobile Screen Width(手機屏幕的寬度) */
//# public static final int SCREEN_WIDTH=176;
//#
//# /** Mobile Screen Height(手機屏幕的高度)*/
//# public static final int SCREEN_HEIGHT=204;
//#
//# /// Keystroke handeling (按鍵控制) ///
//#
//# /** Mobile softkey left (手機左軟鍵鍵值)*/
//# public static final byte SOFT_KEY_LEFT= 22;
//#
//# /** Mobile softkey right (手機右軟鍵鍵值)*/
//# public static final byte SOFT_KEY_RIGHT = 21;
//#
//# /** Mobile Key Up (手機方向鍵上)*/
//# public static final byte KEY_UP = 1;
//#
//# /** Mobile Key Down (手機方向鍵下)*/
//# public static final byte KEY_DOWN = 6;
//#
//# /** Mobile Key LEFT (手機方向鍵左)*/
//# public static final byte KEY_LEFT = 2;
//#
//# /** Mobile Key RIGHT (手機方向鍵右)*/
//# public static final byte KEY_RIGHT = 5;
//#
//# /** Mobile Key FIRE (手機選擇鍵)*/
//# public static final byte KEY_FIRE = 20;
//#
//# /** Resource Path (資源路徑 位于src/RES_PATH ) */
//# public static final String RES_PATH="/res/MOTO_V600/";
//#
//# /** Font Height (字體高度) */
//# public static final int FONT_HEIGHT=20;
//#
//# /** Font Height (字體寬度) */
//# public static final int FONT_WIDTH = 16;
//#
//# /**FONT_SYSTEM 系統默認字體 */
//# public static final Font FONT_SYSTEM=Font.getDefaultFont();
//#
//#elif MOTO_E398
//# /** Mobile Screen Width(手機屏幕的寬度) */
//# public static final int SCREEN_WIDTH=176;
//# /** Mobile Screen Height(手機屏幕的高度)*/
//# public static final int SCREEN_HEIGHT=204;
//#
//# /// Keystroke handeling (按鍵控制) ///
//#
//# /** Mobile softkey left (手機左軟鍵鍵值) MOTO 機型與中國移動要求鍵位相返,所以左右軟件鍵值互換*/
//# public static final byte SOFT_KEY_LEFT= -22;
//#
//# /** Mobile softkey right (手機右軟鍵鍵值) MOTO 機型與中國移動要求鍵位相返,所以左右軟件鍵值互換*/
//# public static final byte SOFT_KEY_RIGHT = -21;
//#
//# /** Mobile Key Up (手機方向鍵上)*/
//# public static final byte KEY_UP = -1;
//#
//# /** Mobile Key Down (手機方向鍵下)*/
//# public static final byte KEY_DOWN = -6;
//#
//# /** Mobile Key LEFT (手機方向鍵左)*/
//# public static final byte KEY_LEFT = -2;
//#
//# /** Mobile Key RIGHT (手機方向鍵右)*/
//# public static final byte KEY_RIGHT = -5;
//#
//# /** Mobile Key FIRE (手機選擇鍵)*/
//# public static final byte KEY_FIRE = -20;
//#
//# /** Resource Path (資源路徑 位于src/RES_PATH )*/
//# public static final String RES_PATH="/res/MOTO_E398/";
//#
//# /** Font Height (字體高度) */
//# public static final int FONT_HEIGHT=20;
//# /** Font Height (字體寬度) */
//# public static final int FONT_WIDTH = 16;
//# /**FONT_SYSTEM 系統默認字體 */
//# public static final Font FONT_SYSTEM=Font.getDefaultFont();
//#
//#elif SE_K700
//# /** Mobile Screen Width(手機屏幕的寬度) */
//# public static final int SCREEN_WIDTH=176;
//#
//# /** Mobile Screen Height(手機屏幕的高度)*/
//# public static final int SCREEN_HEIGHT=220;
//#
//# /** Mobile softkey left (手機左軟鍵鍵值)*/
//# public static final byte SOFT_KEY_LEFT = -6;
//#
//# /** Mobile softkey right (手機右軟鍵鍵值)*/
//# public static final byte SOFT_KEY_RIGHT = -7;
//#
//# /** Mobile Key Up (手機方向鍵上)*/
//# public static final byte KEY_UP = -1;
//#
//# /** Mobile Key Down (手機方向鍵下)*/
//# public static final byte KEY_DOWN = -2;
//#
//# /** Mobile Key LEFT (手機方向鍵左)*/
//# public static final byte KEY_LEFT = -3;
//#
//# /** Mobile Key RIGHT (手機方向鍵右)*/
//# public static final byte KEY_RIGHT = -4;
//#
//# /** Mobile Key FIRE (手機選擇鍵)*/
//# public static final byte KEY_FIRE = -5;
//#
//# /** Resource Path (資源路徑 位于src/RES_PATH ) */
//# public static final String RES_PATH="/res/SE_K700/";
//#
//# /** Font Height (字體高度) */
//# public static final int FONT_HEIGHT=20;
//# /** Font Height (字體寬度) */
//# public static final int FONT_WIDTH = 16;
//# /**FONT_SYSTEM 系統默認字體 */
//# public static final Font FONT_SYSTEM=Font.getFont(Font.STYLE_PLAIN, Font.FACE_SYSTEM, Font.SIZE_SMALL);
//#
//#elif SE_S700
//# /** Mobile Screen Width(手機屏幕的寬度) */
//# public static final int SCREEN_WIDTH=240;
//#
//# /** Mobile Screen Height(手機屏幕的高度)*/
//# public static final int SCREEN_HEIGHT=320;
//#
//# /** Mobile softkey left (手機左軟鍵鍵值)*/
//# public static final byte SOFT_KEY_LEFT = -6;
//#
//# /** Mobile softkey right (手機右軟鍵鍵值)*/
//# public static final byte SOFT_KEY_RIGHT = -7;
//#
//# /** Mobile Key Up (手機方向鍵上)*/
//# public static final byte KEY_UP = -1;
//#
//# /** Mobile Key Down (手機方向鍵下)*/
//# public static final byte KEY_DOWN = -2;
//#
//# /** Mobile Key LEFT (手機方向鍵左)*/
//# public static final byte KEY_LEFT = -3;
//#
//# /** Mobile Key RIGHT (手機方向鍵右)*/
//# public static final byte KEY_RIGHT = -4;
//#
//# /** Mobile Key FIRE (手機選擇鍵)*/
//# public static final byte KEY_FIRE = -5;
//#
//# /** Resource Path (資源路徑 位于src/RES_PATH ) */
//# public static final String RES_PATH="/res/SE_S700/";
//#
//# /** Font Height (字體高度) */
//# public static final int FONT_HEIGHT=20;
//# /** Font Height (字體寬度) */
//# public static final int FONT_WIDTH = 16;
//# /**FONT_SYSTEM 系統默認字體 */
//# public static final Font FONT_SYSTEM=Font.getFont(Font.STYLE_PLAIN, Font.FACE_SYSTEM, Font.SIZE_SMALL);
//#
//#elif NOKIA_S40_V1
//# /** Mobile Screen Width(手機屏幕的寬度) */
//# public static final int SCREEN_WIDTH=128;
//#
//# /** Mobile Screen Height(手機屏幕的高度)*/
//# public static final int SCREEN_HEIGHT=128;
//#
//# /** Mobile softkey left (手機左軟鍵鍵值)*/
//# public static final byte SOFT_KEY_LEFT = -6;
//#
//# /** Mobile softkey right (手機右軟鍵鍵值)*/
//# public static final byte SOFT_KEY_RIGHT = -7;
//#
//# /** Resource Path (資源路徑 位于src/RES_PATH ) */
//# public static final String RES_PATH="/res/NOKIA_S40_V1/";
//#
//# /** Mobile Key Up (手機方向鍵上)*/
//# public static final byte KEY_UP = -1;
//#
//# /** Mobile Key Down (手機方向鍵下)*/
//# public static final byte KEY_DOWN = -2;
//#
//# /** Mobile Key LEFT (手機方向鍵左)*/
//# public static final byte KEY_LEFT = -3;
//#
//# /** Mobile Key RIGHT (手機方向鍵右)*/
//# public static final byte KEY_RIGHT = -4;
//#
//# /** Mobile Key FIRE (手機選擇鍵)*/
//# public static final byte KEY_FIRE = 53;
//# /** Font Height (字體高度) */
//# public static final int FONT_HEIGHT=16;
//# /** Font Height (字體寬度) */
//# public static final int FONT_WIDTH = 16;
//# /**FONT_SYSTEM 系統默認字體 */
//# public static final Font FONT_SYSTEM=Font.getFont(Font.STYLE_PLAIN, Font.FACE_SYSTEM, Font.SIZE_SMALL);
//#elif NOKIA_S40_V2
//# /** Mobile Screen Width(手機屏幕的寬度) */
//# public static final int SCREEN_WIDTH=128;
//#
//# /** Mobile Screen Height(手機屏幕的高度)*/
//# public static final int SCREEN_HEIGHT=128;
//#
//# /** Mobile softkey left (手機左軟鍵鍵值)*/
//# public static final byte SOFT_KEY_LEFT = -6;
//#
//# /** Mobile softkey right (手機右軟鍵鍵值)*/
//# public static final byte SOFT_KEY_RIGHT = -7;
//#
//# /** Mobile Key Up (手機方向鍵上)*/
//# public static final byte KEY_UP = -1;
//#
//# /** Mobile Key Down (手機方向鍵下)*/
//# public static final byte KEY_DOWN = -2;
//#
//# /** Mobile Key LEFT (手機方向鍵左)*/
//# public static final byte KEY_LEFT = -3;
//#
//# /** Mobile Key RIGHT (手機方向鍵右)*/
//# public static final byte KEY_RIGHT = -4;
//#
//# /** Mobile Key FIRE (手機選擇鍵)*/
//# public static final byte KEY_FIRE = -5;
//#
//# /** Resource Path (資源路徑 位于src/RES_PATH) */
//# public static final String RES_PATH="/res/NOKIA_S40_V2/";
//#
//# /** Font Height (字體寬度) */
//# public static final int FONT_WIDTH = 16;
//#
//# /** Font Height (字體高度) */
//# public static final int FONT_HEIGHT=16;
//# /**FONT_SYSTEM 系統默認字體 */
//# public static final Font FONT_SYSTEM=Font.getFont(Font.STYLE_PLAIN, Font.FACE_SYSTEM, Font.SIZE_SMALL);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -