Package com.badlogic.gdx.scenes.scene2d

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


      stage.setScrollFocus(this);
    }

    @Override
    public Actor hit (float x, float y, boolean touchable) {
      Actor actor = super.hit(x, y, touchable);
      return actor != null ? actor : this;
    }
View Full Code Here


    titleCache.setPosition((int)x, (int)y);
    titleCache.draw(batch, parentAlpha);
  }

  public Actor hit (float x, float y, boolean touchable) {
    Actor hit = super.hit(x, y, touchable);
    if (hit == null && isModal && (!touchable || getTouchable() == Touchable.enabled)) return this;
    return hit;
  }
View Full Code Here

      Gdx.input.setOnscreenKeyboardVisible(false);
  }

  private TextField findNextTextField (Array<Actor> actors, TextField best, Vector2 bestCoords, Vector2 currentCoords, boolean up) {
    for (int i = 0, n = actors.size; i < n; i++) {
      Actor actor = actors.get(i);
      if (actor == this) continue;
      if (actor instanceof TextField) {
        TextField textField = (TextField)actor;
        if (textField.isDisabled() || !textField.focusTraversal) continue;
        Vector2 actorCoords = actor.getParent().localToStageCoordinates(tmp3.set(actor.getX(), actor.getY()));
        if ((actorCoords.y < currentCoords.y || (actorCoords.y == currentCoords.y && actorCoords.x > currentCoords.x)) ^ up) {
          if (best == null
            || (actorCoords.y > bestCoords.y || (actorCoords.y == bestCoords.y && actorCoords.x < bestCoords.x)) ^ up) {
            best = (TextField)actor;
            bestCoords.set(actorCoords);
View Full Code Here

    selected = null;
    scroll.list.setTouchable(Touchable.disabled);
    Stage stage = scroll.getStage();
    if (stage != null) {
      if (previousScrollFocus != null && previousScrollFocus.getStage() == null) previousScrollFocus = null;
      Actor actor = stage.getScrollFocus();
      if (actor == null || actor.isDescendantOf(scroll)) stage.setScrollFocus(previousScrollFocus);
    }
    scroll.addAction(sequence(fadeOut(0.15f, Interpolation.fade), removeActor()));
  }
View Full Code Here

      clearActions();
      getColor().a = 0;
      addAction(fadeIn(0.3f, Interpolation.fade));

      previousScrollFocus = null;
      Actor actor = stage.getScrollFocus();
      if (actor != null && !actor.isDescendantOf(this)) previousScrollFocus = actor;

      stage.setScrollFocus(this);
    }
View Full Code Here

      stage.setScrollFocus(this);
    }

    @Override
    public Actor hit (float x, float y, boolean touchable) {
      Actor actor = super.hit(x, y, touchable);
      return actor != null ? actor : this;
    }
View Full Code Here

    drawDebug(stage.getActors(), stage.getBatch());
  }

  static private void drawDebug (Array<Actor> actors, Batch batch) {
    for (int i = 0, n = actors.size; i < n; i++) {
      Actor actor = actors.get(i);
      if (!actor.isVisible()) continue;
      if (actor instanceof Table) ((Table)actor).layout.drawDebug(batch);
      if (actor instanceof Group) drawDebug(((Group)actor).getChildren(), batch);
    }
  }
View Full Code Here

    drawDebug(stage.getActors(), stage.getSpriteBatch());
  }

  static private void drawDebug (Array<Actor> actors, Batch batch) {
    for (int i = 0, n = actors.size; i < n; i++) {
      Actor actor = actors.get(i);
      if (!actor.isVisible()) continue;
      if (actor instanceof Table) ((Table)actor).layout.drawDebug(batch);
      if (actor instanceof Group) drawDebug(((Group)actor).getChildren(), batch);
    }
  }
View Full Code Here

  public void clicked (InputEvent event, float x, float y) {
  }

  /** Returns true if the specified position is over the specified actor or within the tap square. */
  public boolean isOver (Actor actor, float x, float y) {
    Actor hit = actor.hit(x, y, true);
    if (hit == null || !hit.isDescendantOf(actor)) return inTapSquare(x, y);
    return true;
  }
View Full Code Here

    public void initGDXUI() {
        Gdx.input.setInputProcessor(stage.stage);
        for (IMarker element : drawStorage) {
            element.setIsDrawn(false);
           
            Actor newActor = new WidgetLink(element).actor;
           
            if (newActor != null) {           
            stage.stage.addActor(newActor);
            }
        }
View Full Code Here

TOP

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

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.