libgdx API

com.badlogic.gdx.math
Class Polygon

java.lang.Object
  extended by com.badlogic.gdx.math.Polygon

public class Polygon
extends java.lang.Object


Constructor Summary
Polygon(float[] vertices)
           
 
Method Summary
 float area()
           
 boolean contains(float x, float y)
           
 void dirty()
           
 Rectangle getBoundingRectangle()
           
 float getOriginX()
           
 float getOriginY()
           
 float getRotation()
           
 float getScaleX()
           
 float getScaleY()
           
 float[] getTransformedVertices()
          Returns vertices scaled, rotated, and offset by the polygon position.
 float[] getVertices()
          Returns vertices without scaling or rotation and without being offset by the polygon position.
 float getX()
           
 float getY()
           
 void rotate(float degrees)
           
 void scale(float amount)
           
 void setOrigin(float originX, float originY)
           
 void setPosition(float x, float y)
           
 void setRotation(float degrees)
           
 void setScale(float scaleX, float scaleY)
           
 void translate(float x, float y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Polygon

public Polygon(float[] vertices)
Method Detail

getVertices

public float[] getVertices()
Returns vertices without scaling or rotation and without being offset by the polygon position.


getTransformedVertices

public float[] getTransformedVertices()
Returns vertices scaled, rotated, and offset by the polygon position.


setOrigin

public void setOrigin(float originX,
                      float originY)

setPosition

public void setPosition(float x,
                        float y)

translate

public void translate(float x,
                      float y)

setRotation

public void setRotation(float degrees)

rotate

public void rotate(float degrees)

setScale

public void setScale(float scaleX,
                     float scaleY)

scale

public void scale(float amount)

dirty

public void dirty()

area

public float area()

getBoundingRectangle

public Rectangle getBoundingRectangle()

contains

public boolean contains(float x,
                        float y)

getX

public float getX()

getY

public float getY()

getOriginX

public float getOriginX()

getOriginY

public float getOriginY()

getRotation

public float getRotation()

getScaleX

public float getScaleX()

getScaleY

public float getScaleY()

libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)