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

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

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

Stage.touchUp介绍

[英]Applies a touch up 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/core

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

代码示例来源:origin: mstojcevich/Radix

@Override
public void onMouseClick(int button, boolean up) {
  if(up) {
    stage.touchUp(mouseX, mouseY, 0, button);
  } else {
    stage.touchDown(mouseX, mouseY, 0, button);
  }
}

代码示例来源:origin: mstojcevich/Radix

@Override
public void onMouseClick(int button, boolean up) {
  if(up) {
    stage.touchUp(mouseX, mouseY, 0, button);
  } else {
    stage.touchDown(mouseX, mouseY, 0, button);
  }
}

代码示例来源:origin: mstojcevich/Radix

@Override
public void onMouseClick(int button, boolean up) {
  if(up) {
    stage.touchUp(mouseX, mouseY, 0, button);
  } else {
    stage.touchDown(mouseX, mouseY, 0, button);
  }
}

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

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

代码示例来源:origin: danialgoodwin/dev

@Override
public boolean touchUp(int screenX, int screenY, int pointer, int button) {
  if (runner.isDodging()) {
    runner.stopDodge();
  }
  return super.touchUp(screenX, screenY, pointer, button);
}

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

/** Called when a finger was lifted or a mouse button was released. The button parameter will be {@link Buttons#LEFT} on iOS.
 * @param pointer the pointer for the event.
 * @param button the button
 * @return whether the input was processed */
public boolean touchUp (int screenX, int screenY, int pointer, int button){
  if($.allMatch(processors(), p -> p.touchUp(screenX, screenY, pointer, button)) && onInput()){
    stage.touchUp(screenX, screenY, pointer, button);
    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);
  }
}

相关文章