Package com.badlogic.gdx.scenes.scene2d

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


   
    int size = list.size;
    int index = 0;
    while (index < size && !handled)
    {
      Actor actor = list.get(index);
     
      if (actor instanceof Layer)
      {
        Layer layer = (Layer) actor;
       
View Full Code Here


   
    int size = list.size;
    int index = 0;
    while (index < size && !handled)
    {
      Actor actor = list.get(index);
     
      if (actor instanceof Layer)
      {
        Layer layer = (Layer) actor;
       
View Full Code Here

   
    int size = list.size;
    int index = 0;
    while (index < size && !handled)
    {
      Actor actor = list.get(index);
     
      if (actor instanceof Layer)
      {
        Layer layer = (Layer) actor;
       
View Full Code Here

   
    int size = list.size;
    int index = 0;
    while (index < size && !handled)
    {
      Actor actor = list.get(index);
     
      if (actor instanceof Layer)
      {
        Layer layer = (Layer) actor;
       
View Full Code Here

   * on any hit tests to items on layers below it.
   */
  @Override
  public Actor hit(float x, float y, boolean touchable)
  {
    Actor hit = super.hit(x, y, touchable);
   
    if (hit == this)
    {
      hit = null;
    }
View Full Code Here

  @SuppressWarnings("rawtypes")
  public static Actor hit(float x, float y, Group group, Class targetClass)
  {
    SnapshotArray<Actor> children = group.getChildren();

    Actor hit = null;
    boolean found = false;
    int index = children.size - 1;
    while (!found && index >= 0)
    {
      Actor child = children.get(index);

      if (child.getClass().isAssignableFrom(targetClass))
      {
        point.x = x;
        point.y = y;

        group.localToDescendantCoordinates(child, point);

        if (child.hit(point.x, point.y, true) != null)
        {
          found = true;
          hit = child;
        }
        else if (child instanceof Group)
View Full Code Here

  @SuppressWarnings("rawtypes")
  public static Actor intersects(float x, float y, float width, float height, Group group, Class targetClass)
  {
    SnapshotArray<Actor> children = group.getChildren();

    Actor hit = null;
    int index = children.size - 1;
    while (hit == null && index >= 0)
    {
      Actor child = children.get(index);

      point.x = x;
      point.y = y;

      group.localToDescendantCoordinates(child, point);

      // If child is our target class then immediately check for
      // intersection
      if (child.getClass().equals(targetClass))
      {
        if (isIntersect(point.x, point.y, width, height, 0, 0, child.getWidth(), child.getHeight()))
        {
          hit = child;
        }
      }
      else if (child instanceof Group)
View Full Code Here

  {
    Group root = stage.getRoot();

    SnapshotArray<Actor> children = root.getChildren();

    Actor hit = null;
    boolean found = false;
    int index = children.size - 1;
    while (!found && index >= 0)
    {
      Actor child = children.get(index);

      point.x = x;
      point.y = y;

      root.localToDescendantCoordinates(child, point);

      Actor childHit = root.hit(point.x, point.y, true);

      if (childHit != null && childHit.getClass().isAssignableFrom(targetClass))
      {
        found = true;
        hit = childHit;
      }
      else
View Full Code Here

  }

  private void setLayoutEnabled (Group parent, boolean enabled) {
    SnapshotArray<Actor> children = getChildren();
    for (int i = 0, n = children.size; i < n; i++) {
      Actor actor = children.get(i);
      if (actor instanceof Layout)
        ((Layout)actor).setLayoutEnabled(enabled);
      else if (actor instanceof Group) //
        setLayoutEnabled((Group)actor, enabled);
    }
View Full Code Here

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

  static private void drawDebug (Array<Actor> actors, SpriteBatch 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

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.