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

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

Introduction

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

Prototype

public float getScaleY() 

Source Link

Document

Returns the total vertical 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);/* w  ww .j a  v  a2 s  . c  om*/
    }

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