Example usage for com.badlogic.gdx.math Rectangle getPosition

List of usage examples for com.badlogic.gdx.math Rectangle getPosition

Introduction

In this page you can find the example usage for com.badlogic.gdx.math Rectangle getPosition.

Prototype

public Vector2 getPosition(Vector2 position) 

Source Link

Document

return the Vector2 with coordinates of this rectangle

Usage

From source file:com.me.mygdxgame.WallActor.java

License:Apache License

private void boundsToM(Rectangle boundsPix, PolygonShape rectangleShape) {
    Vector2 halfSizeM = new Vector2(), centerM = new Vector2();
    boundsPix.getPosition(centerM);
    centerM.div(gdxTest.getPixelsPerMeter());
    boundsPix.getPosition(centerM);// w ww.  j  ava2s.com
    centerM.div(gdxTest.getPixelsPerMeter());

    rectangleShape.setAsBox(halfSizeM.x, halfSizeM.y, centerM, 0f);
}

From source file:uk.josephmansfield.interplanar.CollisionBody.java

License:Open Source License

public CollisionBody(Rectangle boundingRectangle) {
    boundingRectangle.getPosition(position);
    dimensions.set(boundingRectangle.getWidth(), boundingRectangle.getHeight());
}