📄 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 + -