当前位置: 首页>>代码示例>>Java>>正文


Java Canvas.GAME_A属性代码示例

本文整理汇总了Java中javax.microedition.lcdui.Canvas.GAME_A属性的典型用法代码示例。如果您正苦于以下问题:Java Canvas.GAME_A属性的具体用法?Java Canvas.GAME_A怎么用?Java Canvas.GAME_A使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.microedition.lcdui.Canvas的用法示例。


在下文中一共展示了Canvas.GAME_A属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: InputManager

private InputManager() {
	up = new Input(Canvas.UP);
	down = new Input(Canvas.DOWN);
	left = new Input(Canvas.LEFT);
	right = new Input(Canvas.RIGHT);
	fire = new Input(Canvas.FIRE);
	gamea = new Input(Canvas.GAME_A);
	gameb = new Input(Canvas.GAME_B);
	gamec = new Input(Canvas.GAME_C);
	gamed = new Input(Canvas.GAME_D);
	
	num0 = new Input(Canvas.KEY_NUM0);
	num1 = new Input(Canvas.KEY_NUM1);
	num2 = new Input(Canvas.KEY_NUM2);
	num3 = new Input(Canvas.KEY_NUM3);
	num4 = new Input(Canvas.KEY_NUM4);
	num5 = new Input(Canvas.KEY_NUM5);
	num6 = new Input(Canvas.KEY_NUM6);
	num7 = new Input(Canvas.KEY_NUM7);
	num8 = new Input(Canvas.KEY_NUM8);
	num9 = new Input(Canvas.KEY_NUM9);
	star = new Input(Canvas.KEY_STAR);
	pound = new Input(Canvas.KEY_POUND);
}
 
开发者ID:RobDangerous,项目名称:Jademula,代码行数:24,代码来源:InputManager.java

示例2: getKeyCode

@Override
public int getKeyCode(int gameAction) {
	int keyCode;
	switch (gameAction) {
	case Canvas.FIRE:
		keyCode = -5;
		break;
	case Canvas.UP:
		keyCode = -1;
		break;
	case Canvas.DOWN:
		keyCode = -2;
		break;
	case Canvas.LEFT:
		keyCode = -3;
		break;
	case Canvas.RIGHT:
		keyCode = -4;
		break;
	case Canvas.GAME_A:
		keyCode = Canvas.GAME_A;
		break;
	case Canvas.GAME_B:
		keyCode = Canvas.GAME_B;
		break;
	case Canvas.GAME_C:
		keyCode = Canvas.GAME_C;
		break;
	case Canvas.GAME_D:
		keyCode = Canvas.GAME_D;
		break;
	default:
		throw new IllegalArgumentException();
	}

	return keyCode;
}
 
开发者ID:Helltar,项目名称:AMPASIDE,代码行数:37,代码来源:AndroidInputMethod.java

示例3: getKeyName

@Override
public String getKeyName(int keyCode) throws IllegalArgumentException {
	// TODO implement as lookup table
	String keyName;
	switch (keyCode) {
	case Canvas.FIRE:
		keyName = "FIRE";
		break;
	case Canvas.UP:
		keyName = "UP";
		break;
	case Canvas.DOWN:
		keyName = "DOWN";
		break;
	case Canvas.LEFT:
		keyName = "LEFT";
		break;
	case Canvas.RIGHT:
		keyName = "RIGHT";
		break;
	case Canvas.GAME_A:
		keyName = "GAME_A";
		break;
	case Canvas.GAME_B:
		keyName = "GAME_B";
		break;
	case Canvas.GAME_C:
		keyName = "GAME_C";
		break;
	case Canvas.GAME_D:
		keyName = "GAME_D";
		break;
	default:
		keyName = Character.toString((char) keyCode);
	}

	return keyName;
}
 
开发者ID:Helltar,项目名称:AMPASIDE,代码行数:38,代码来源:AndroidInputMethod.java


注:本文中的javax.microedition.lcdui.Canvas.GAME_A属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。