Example usage for com.badlogic.gdx.scenes.scene2d Actor parentToLocalCoordinates

List of usage examples for com.badlogic.gdx.scenes.scene2d Actor parentToLocalCoordinates

Introduction

In this page you can find the example usage for com.badlogic.gdx.scenes.scene2d Actor parentToLocalCoordinates.

Prototype

public Vector2 parentToLocalCoordinates(Vector2 parentCoords) 

Source Link

Document

Converts the coordinates given in the parent's coordinate system to this actor's coordinate system.

Usage

From source file:com.strategames.engine.scenes.scene2d.Stage.java

License:Open Source License

public Array<Actor> getActorsAt(float x, float y) {
    Array<Actor> actors = getActors();
    Array<Actor> actorsHit = new Array<Actor>();
    Vector2 point = new Vector2();
    for (int i = 0; i < actors.size; i++) {
        Actor actor = actors.get(i);
        actor.parentToLocalCoordinates(point.set(x, y));
        if (actor.hit(point.x, point.y, false) != null) {
            actorsHit.add(actor);/* ww w .j av  a2  s  .c o m*/
        }
    }
    return actorsHit;
}