com.badlogic.gdx.scenes.scene2d.Stage.keyDown()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.0k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中com.badlogic.gdx.scenes.scene2d.Stage.keyDown()方法的一些代码示例,展示了Stage.keyDown()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Stage.keyDown()方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.Stage
类名称:Stage
方法名:keyDown

Stage.keyDown介绍

[英]Applies a key down event to the actor that has Stage#setKeyboardFocus(Actor), if any, and returns true if the event was Event#handle().
[中]对具有Stage#setKeyboardFocus(actor)(如果有)的参与者应用按键关闭事件,如果事件为event#handle(),则返回true。

代码示例

代码示例来源:origin: com.lwgame.gdx/lwgame-core

@Override
public boolean keyDown(int keycode) {
  return stage.keyDown(keycode) || !isTransparent();
}

代码示例来源:origin: com.lwgame.gdx/core

@Override
public boolean keyDown(int keycode) {
  return stage.keyDown(keycode) || !isTransparent();
}

代码示例来源:origin: dingjibang/GDX-RPG

/** Called when a key was pressed
 * 
 * @param keycode one of the constants in {@link Input.Keys}
 * @return whether the input was processed */
public boolean keyDown (int keycode){
  if($.allMatch(processors(), p -> p.keyDown(keycode)) && onInput()){
    stage.keyDown(keycode);
    return bubble;
  }
  return false;
};

相关文章