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;
    float height = getHeight();
    if (hit == null || hit == this) return hit;
    if (y <= height && y >= height - getPadTop() && x >= 0 && x <= getWidth()) {
      // Hit the title bar, don't use the hit child if it is in the Window's table.
      Actor current = hit;
      while (current.getParent() != this)
        current = current.getParent();
      if (getCell(current) != null) 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

      Gdx.input.setOnscreenKeyboardVisible(false);
  }

  private TextField findNextTextField (List<Actor> actors, TextField best, boolean up) {
    for (int i = 0, n = actors.size(); i < n; i++) {
      Actor actor = actors.get(i);
      if (actor instanceof TextField) {
        if (actor == this) continue;
        if (actor.y == y) {
          if (best == null && actor.x >= x ^ up) best = (TextField)actor;
        } else if (actor.y < y ^ up && (best == null || actor.y - y > best.y - y ^ up)) {
View Full Code Here

    if (object instanceof String) {
      if (layout.skin == null) throw new IllegalStateException("Label cannot be created, no skin has been set.");
      return new Label((String)object, layout.skin);
    }
    if (object == null) {
      return new Actor() {
        {
          visible = false;
        }

        public void draw (SpriteBatch batch, float parentAlpha) {
View Full Code Here

      offsetX = style.unpressedOffsetX;
      offsetY = style.unpressedOffsetY;
    }
    validate();
    for (int i = 0; i < children.size(); i++) {
      Actor child = children.get(i);
      child.x += offsetX;
      child.y += offsetY;
    }
    super.draw(batch, parentAlpha);
    for (int i = 0; i < children.size(); i++) {
      Actor child = children.get(i);
      child.x -= offsetX;
      child.y -= offsetY;
    }
  }
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.