Package com.badlogic.gdx.scenes.scene2d

Examples of com.badlogic.gdx.scenes.scene2d.InputListener


      setOverscroll(false, false);
      setFadeScrollBars(false);

      list = new List(style.listStyle);
      setWidget(list);
      list.addListener(new InputListener() {
        public boolean mouseMoved (InputEvent event, float x, float y) {
          list.setSelectedIndex(Math.min(items.size - 1, (int)((list.getHeight() - y) / list.getItemHeight())));
          return true;
        }
      });

      addListener(new InputListener() {
        public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
          if (event.getTarget() == list) return true;
          setSelected(selected); // Revert.
          hideList();
          return false;
View Full Code Here


    button.setWidth(400);
    button.setHeight(100);
    button.setX(Gdx.graphics.getWidth() / 2 - button.getWidth() / 2);
    button.setY(Gdx.graphics.getHeight() / 2 - button.getHeight() / 2);

    button.addListener(new InputListener() {
      public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
        System.out.println("down");
        return true;
      }
View Full Code Here

    no.setHeight(2 * Configuration.gameScale);
    no.setScale(Configuration.gameScale / 20);

    no.setPosition((playArea.x + (playArea.width / 2)), (playArea.y + playArea.height * .45f));

    no.addListener(new InputListener() {
      public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
        System.out.println("down");
        return true;
      }

View Full Code Here

    yes.setHeight(2 * Configuration.gameScale);

    yes.setPosition((playArea.x + (playArea.width / 2) - (4 * Configuration.gameScale)),
        (playArea.y + playArea.height * .45f));
    yes.setScale(Configuration.gameScale / 20);
    yes.addListener(new InputListener() {
      public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
        System.out.println("down");
        return true;
      }

View Full Code Here

    button.setWidth(400);
    button.setHeight(100);
    button.setX(Gdx.graphics.getWidth() / 2 - button.getWidth() / 2);
    button.setY(Gdx.graphics.getHeight() / 2 - button.getHeight() / 2);

    button.addListener(new InputListener() {
      public boolean touchDown(InputEvent event, float x, float y,
          int pointer, int button) {
        return true;
      }
View Full Code Here

  }

  /** If this key is pressed, {@link #result(Object)} is called with the specified object.
   * @see Keys */
  public Dialog key (final int keycode, final Object object) {
    addListener(new InputListener() {
      public boolean keyDown (InputEvent event, int keycode2) {
        if (keycode == keycode2) {
          result(object);
          if (!cancelHide) hide();
          cancelHide = false;
View Full Code Here

    setStyle(style);
    setItems(items);
    setWidth(getPrefWidth());
    setHeight(getPrefHeight());

    addListener(new InputListener() {
      public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
        if (pointer == 0 && button != 0) return false;
        if (!isSelectable()) return false; // don't eat touch event when NOT selectable
        List.this.touchDown(y);
        return true;
View Full Code Here

    setStyle(style);
    setWidth(getPrefWidth());
    setHeight(getPrefHeight());

    addListener(new InputListener() {
      @Override
      public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
        if (touched) return false;
        touched = true;
        calculatePositionAndValue(x, y, false);
View Full Code Here

    setHeight(getPrefHeight());
    initialize();
  }

  private void initialize () {
    addListener(new InputListener() {
      int draggingPointer = -1;

      public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
        if (draggingPointer != -1) return false;
        if (pointer == 0 && button != 0) return false;
View Full Code Here

    this.vertical = vertical;
    this.value = min;
    setWidth(getPrefWidth());
    setHeight(getPrefHeight());

    addListener(new InputListener() {
      public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
        if (disabled) return false;
        if (draggingPointer != -1) return false;
        draggingPointer = pointer;
        calculatePositionAndValue(x, y);
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.scenes.scene2d.InputListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.