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

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

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

Stage.touchDragged介绍

[英]Applies a touch moved event to the stage and returns true if an actor in the scene Event#handle() the event. Only InputListener that returned true for touchDown will receive this event.
[中]将触动事件应用于舞台,如果场景事件中的演员#处理()该事件,则返回true。只有在着陆时返回true的InputListener才会收到此事件。

代码示例

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

@Override
public boolean touchDragged(int screenX, int screenY, int pointer) {
  return stage.touchDragged(screenX, screenY, pointer) || !isTransparent();
}

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

@Override
public boolean touchDragged(int screenX, int screenY, int pointer) {
  return stage.touchDragged(screenX, screenY, pointer) || !isTransparent();
}

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

/** Called when a finger or the mouse was dragged.
 * @param pointer the pointer for the event.
 * @return whether the input was processed */
public boolean touchDragged (int screenX, int screenY, int pointer){
  if($.allMatch(processors(), p -> p.touchDragged(screenX, screenY, pointer)) && onInput()){
    stage.touchDragged(screenX, screenY, pointer);
    return bubble;
  }
  return false;
};

代码示例来源:origin: net.mostlyoriginal.artemis-odb/contrib-plugin-profiler

/** Emulate stage input to maintain pre-existing input processor. */
private void processInput() {
  if ( Gdx.input.isButtonPressed(Input.Buttons.LEFT)) {
    if ( !leftMouseDown) {
      leftMouseDown = true;
      stage.touchDown(Gdx.input.getX(), Gdx.input.getY(), 0, Input.Buttons.LEFT);
    } else {
      stage.touchDragged(Gdx.input.getX(), Gdx.input.getY(), 0);
    }
  } else if (leftMouseDown)  {
    leftMouseDown = false;
    stage.touchUp(Gdx.input.getX(), Gdx.input.getY(), 0, Input.Buttons.LEFT);
  }
}

代码示例来源:origin: DaanVanYperen/artemis-odb-contrib

/** Emulate stage input to maintain pre-existing input processor. */
private void processInput() {
  if ( Gdx.input.isButtonPressed(Input.Buttons.LEFT)) {
    if ( !leftMouseDown) {
      leftMouseDown = true;
      stage.touchDown(Gdx.input.getX(), Gdx.input.getY(), 0, Input.Buttons.LEFT);
    } else {
      stage.touchDragged(Gdx.input.getX(), Gdx.input.getY(), 0);
    }
  } else if (leftMouseDown)  {
    leftMouseDown = false;
    stage.touchUp(Gdx.input.getX(), Gdx.input.getY(), 0, Input.Buttons.LEFT);
  }
}

相关文章