Example usage for com.badlogic.gdx.math Polygon getScaleX

List of usage examples for com.badlogic.gdx.math Polygon getScaleX

Introduction

In this page you can find the example usage for com.badlogic.gdx.math Polygon getScaleX.

Prototype

public float getScaleX() 

Source Link

Document

Returns the total horizontal scaling applied to the polygon.

Usage

From source file:org.bladecoder.bladeengine.polygonalpathfinder.PolygonalNavGraph.java

License:Apache License

@Override
public void write(Json json) {
    Polygon p = new Polygon(walkZone.getVertices());
    p.setPosition(walkZone.getX() / walkZone.getScaleX(), walkZone.getY() / walkZone.getScaleY());
    json.writeValue("walkZone", p);

    ArrayList<Polygon> tmp = new ArrayList<Polygon>();

    for (Polygon poly : obstacles) {
        // To SAVE space not writing worldVertices
        p = new Polygon(poly.getVertices());
        p.setPosition(poly.getX() / poly.getScaleX(), poly.getY() / poly.getScaleY());
        tmp.add(p);/*from w  w  w.  j  a va2  s. co  m*/
    }

    json.writeValue("obstacles", tmp, ArrayList.class, Polygon.class);
}