【发布时间】:2017-12-06 12:49:47
【问题描述】:
我正在使用 LibGDX。
假设我不想跳跃 - 但不是真正触摸屏幕,我不想使用键盘,并且实现触摸,就像我在触摸屏幕一样。 我可以这样做吗?
我们可以说“测试”按钮而不按下它吗(从应用程序/android/ios/等的触摸屏)?
来自 InputListener 的按钮示例:
final Image imageJumpButton = new Image(new Texture("jbjump.png"));
imageJumpButton.addListener(new InputListener() {
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
JOYSTICK_UP= true;
return true;
}
@Override
public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
JOYSTICK_UP = false;
}
});
谢谢你。
【问题讨论】:
标签: java android libgdx touchscreen