Package com.badlogic.gdx.scenes.scene2d

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


    float padTop = getPadTop();

    if (style.stageBackground != null) {
      Color color = getColor();
      batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
      Stage stage = getStage();
      stageToLocalCoordinates(/* in/out */tmpPosition.set(0, 0));
      stageToLocalCoordinates(/* in/out */tmpSize.set(stage.getWidth(), stage.getHeight()));
      style.stageBackground.draw(batch, x + tmpPosition.x, y + tmpPosition.y, x + tmpSize.x, y + tmpSize.y);
    }

    super.drawBackground(batch, parentAlpha);

View Full Code Here


    fadeDelay = fadeDelaySeconds;
  }

  void cancelTouchFocusedChild (InputEvent event) {
    if (!cancelTouchFocus) return;
    Stage stage = getStage();
    if (stage != null) stage.cancelTouchFocus(flickScrollListener, this);
  }
View Full Code Here

    }

    @Override
    public void show() {

        stage = new Stage();

        Table table = new Table(game.getSkin());
        table.setFillParent(true);
        table.center();
View Full Code Here

  }

    @Override
    public void show() {

        stage = new Stage();

        Table table = new Table(game.getSkin());
        table.setFillParent(true);
        table.center();
View Full Code Here

        this.game = game;

        Texture.setEnforcePotImages(false);
        splashTexture = new Texture(Gdx.files.internal("ui/splash.png"));
        splashImage = new Image(splashTexture);
        stage = new Stage();
    }
View Full Code Here

    }
  }

  @Override
  public void draw (Batch batch, float parentAlpha) {
    Stage stage = getStage();
    boolean focused = stage != null && stage.getKeyboardFocus() == this;

    final BitmapFont font = style.font;
    final Color fontColor = (disabled && style.disabledFontColor != null) ? style.disabledFontColor
      : ((focused && style.focusedFontColor != null) ? style.focusedFontColor : style.fontColor);
    final Drawable selection = style.selection;
View Full Code Here

  }

  /** Focuses the next TextField. If none is found, the keyboard is hidden. Does nothing if the text field is not in a stage.
   * @param up If true, the TextField with the same or next smallest y coordinate is found, else the next highest. */
  public void next (boolean up) {
    Stage stage = getStage();
    if (stage == null) return;
    getParent().localToStageCoordinates(tmp1.set(getX(), getY()));
    TextField textField = findNextTextField(stage.getActors(), null, tmp2, tmp1, up);
    if (textField == null) { // Try to wrap around.
      if (up)
        tmp1.set(Float.MIN_VALUE, Float.MIN_VALUE);
      else
        tmp1.set(Float.MAX_VALUE, Float.MAX_VALUE);
      textField = findNextTextField(getStage().getActors(), null, tmp2, tmp1, up);
    }
    if (textField != null)
      stage.setKeyboardFocus(textField);
    else
      Gdx.input.setOnscreenKeyboardVisible(false);
  }
View Full Code Here

      if (!super.touchDown(event, x, y, pointer, button)) return false;
      if (pointer == 0 && button != 0) return false;
      if (disabled) return true;
      setCursorPosition(x, y);
      selectionStart = cursor;
      Stage stage = getStage();
      if (stage != null) stage.setKeyboardFocus(TextField.this);
      keyboard.show(true);
      hasSelection = true;
      return true;
    }
View Full Code Here

      if (disabled) return false;

      lastBlink = 0;
      cursorOn = false;

      Stage stage = getStage();
      if (stage == null || stage.getKeyboardFocus() != TextField.this) return false;

      boolean repeat = false;
      boolean ctrl = UIUtils.ctrl();
      boolean jump = ctrl && !passwordMode;
View Full Code Here

    }

    public boolean keyTyped (InputEvent event, char character) {
      if (disabled) return false;

      Stage stage = getStage();
      if (stage == null || stage.getKeyboardFocus() != TextField.this) return false;

      if ((character == TAB || character == ENTER_ANDROID) && focusTraversal) {
        next(UIUtils.shift());
      } else {
        boolean delete = character == DELETE;
View Full Code Here

TOP

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

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.