Package com.badlogic.gdx.scenes.scene2d

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


  }

  /** 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

        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

        loadScreen();
  }

    private void loadScreen() {

        stage = new Stage();

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

    stage.draw();
  }
 
  private void loadScreen() {
    // Grafo de escena que contiene el menú
    stage = new Stage();
         
    // Crea una tabla, donde añadiremos los elementos de menú
    Table table = new Table(game.getSkin());
        table.setFillParent(true);
        table.center();
View Full Code Here

*/
public class R2ViewportHandler {
  private Stage stage; // TODO: Change to R2Stage

  public R2ViewportHandler(float width, float height) {
  stage = new Stage(new StretchViewport(width, height));
  }
View Full Code Here

      this.x = x;
      width = SelectBox.this.width;
      height = 100;
      this.oldScreenCoords.set(screenCoords);
      layout();
      Stage stage = SelectBox.this.getStage();
      if (y - height < 0 && y + SelectBox.this.height + height < SelectBox.this.getStage().getCamera().viewportHeight)
        this.y = y + SelectBox.this.height;
      else
        this.y = y - height;
    }
View Full Code Here

  this(null);
  }

  public void create() {
  batch = new SpriteBatch();
  MASTER_STAGE = new Stage(new StretchViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()));
  Skin MASTERSKIN = new Skin(Gdx.files.internal("uiskin.json"));
  fps = new Label("FPS: ", MASTERSKIN);
  Table tmp = new Table();
  tmp.setFillParent(true);
  tmp.top().left();
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.