APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.graphics.g2d

public Class PolygonRegion

extends Object
Class Inheritance

Defines a polygon shape on top of a texture region to avoid drawing transparent pixels.
Authors
Stefan Bachmann, Nathan Sweet
See Also
PolygonRegionLoader

Field Summary

Modifier and TypeField and Description
pack-priv final TextureRegion
pack-priv final float[]
pack-priv final short[]
pack-priv final float[]

Constructor Summary

AccessConstructor and Description
public
PolygonRegion(TextureRegion
the region used for drawing
region
,
float[]
contains 2D polygon coordinates in pixels relative to source region
vertices
,
short[] triangles)

Creates a PolygonRegion by triangulating the polygon coordinates in vertices and calculates uvs based on that.

Method Summary

Modifier and TypeMethod and Description
public TextureRegion
public float[]
public short[]
public float[]
getVertices()

Returns the vertices in local space.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

regionback to summary
pack-priv final TextureRegion region
textureCoordsback to summary
pack-priv final float[] textureCoords
trianglesback to summary
pack-priv final short[] triangles
verticesback to summary
pack-priv final float[] vertices

Constructor Detail

PolygonRegionback to summary
public PolygonRegion(TextureRegion region, float[] vertices, short[] triangles)

Creates a PolygonRegion by triangulating the polygon coordinates in vertices and calculates uvs based on that. TextureRegion can come from an atlas.

Parameters
region:TextureRegion

the region used for drawing

vertices:float[]

contains 2D polygon coordinates in pixels relative to source region

Method Detail

getRegionback to summary
public TextureRegion getRegion()
getTextureCoordsback to summary
public float[] getTextureCoords()
getTrianglesback to summary
public short[] getTriangles()
getVerticesback to summary
public float[] getVertices()

Returns the vertices in local space.