com.badlogic.gdx.graphics.g2d
Class PolygonRegion
java.lang.Object
com.badlogic.gdx.graphics.g2d.PolygonRegion
public class PolygonRegion
- extends java.lang.Object
Defines a polygon shape on top of a #TextureRegion for minimising pixel drawing. Can either be constructed through a .psh file
from an external editor or programmatically through a list of vertices defining a polygon.
THIS STUFF IS WIP
- Author:
- Stefan Bachmann
Constructor Summary |
PolygonRegion(TextureRegion region,
FileHandle file)
Creates a PolygonRegion by reading in the vertices and texture coordinates from the external file. |
PolygonRegion(TextureRegion region,
float[] vertices)
Creates a PolygonRegin by triangulating the polygon coordinates in vertices and calculates uvs based on that. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PolygonRegion
public PolygonRegion(TextureRegion region,
FileHandle file)
- Creates a PolygonRegion by reading in the vertices and texture coordinates from the external file. TextureRegion can come
from an atlas.
- Parameters:
region
- the region used for drawingfile
- polygon shape definition file
PolygonRegion
public PolygonRegion(TextureRegion region,
float[] vertices)
- Creates a PolygonRegin by triangulating the polygon coordinates in vertices and calculates uvs based on that. TextureRegion
can come from an atlas.
- Parameters:
region
- the region used for drawingvertices
- contains 2D polygon coordinates in pixels relative to source region
getLocalVertices
public float[] getLocalVertices()
getTextureCoords
public float[] getTextureCoords()
getRegion
public TextureRegion getRegion()
Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)