本文整理匯總了Java中com.badlogic.gdx.Input.Buttons.FORWARD屬性的典型用法代碼示例。如果您正苦於以下問題:Java Buttons.FORWARD屬性的具體用法?Java Buttons.FORWARD怎麽用?Java Buttons.FORWARD使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.badlogic.gdx.Input.Buttons
的用法示例。
在下文中一共展示了Buttons.FORWARD屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: convertMouse
@VisibleForTesting
static KeyCode convertMouse(int button) {
switch (button) {
case Buttons.LEFT: return KeyCode.MOUSE_LEFT;
case Buttons.MIDDLE: return KeyCode.MOUSE_MIDDLE;
case Buttons.RIGHT: return KeyCode.MOUSE_RIGHT;
case Buttons.BACK: return KeyCode.MOUSE_BACK;
case Buttons.FORWARD: return KeyCode.MOUSE_FORWARD;
default:
LOG.warn("Unmapped mouse button: {}", button);
return KeyCode.UNKNOWN;
}
}
示例2: toGdxButton
private int toGdxButton (int button) {
if (button == 0) return Buttons.LEFT;
if (button == 1) return Buttons.RIGHT;
if (button == 2) return Buttons.MIDDLE;
if (button == 3) return Buttons.BACK;
if (button == 4) return Buttons.FORWARD;
return -1;
}
示例3: toLwjglButton
private int toLwjglButton (int button) {
switch (button) {
case Buttons.LEFT:
return 0;
case Buttons.RIGHT:
return 1;
case Buttons.MIDDLE:
return 2;
case Buttons.BACK:
return 3;
case Buttons.FORWARD:
return 4;
}
return 0;
}
示例4: toGdxButton
private int toGdxButton (int button) {
if (button == 0 || button == 1) return Buttons.LEFT;
if (button == 2) return Buttons.RIGHT;
if (button == 4) return Buttons.MIDDLE;
if (button == 8) return Buttons.BACK;
if (button == 16) return Buttons.FORWARD;
return -1;
}
示例5: getButtonString
private String getButtonString (int button) {
if (button == Buttons.LEFT) return "left";
if (button == Buttons.RIGHT) return "right";
if (button == Buttons.MIDDLE) return "middle";
if (button == Buttons.BACK) return "back";
if (button == Buttons.FORWARD) return "forward";
return "unknown";
}