• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  *
3  */
4 
5 package com.badlogic.gdx.maps.objects;
6 
7 import com.badlogic.gdx.maps.MapObject;
8 import com.badlogic.gdx.math.Polygon;
9 
10 /** @brief Represents {@link Polygon} map objects */
11 public class PolygonMapObject extends MapObject {
12 
13 	private Polygon polygon;
14 
15 	/** @return polygon shape */
getPolygon()16 	public Polygon getPolygon () {
17 		return polygon;
18 	}
19 
20 	/** @param polygon new object's polygon shape */
setPolygon(Polygon polygon)21 	public void setPolygon (Polygon polygon) {
22 		this.polygon = polygon;
23 	}
24 
25 	/** Creates empty polygon map object */
PolygonMapObject()26 	public PolygonMapObject () {
27 		this(new float[0]);
28 	}
29 
30 	/** @param vertices polygon defining vertices (at least 3) */
PolygonMapObject(float[] vertices)31 	public PolygonMapObject (float[] vertices) {
32 		polygon = new Polygon(vertices);
33 	}
34 
35 	/** @param polygon the polygon */
PolygonMapObject(Polygon polygon)36 	public PolygonMapObject (Polygon polygon) {
37 		this.polygon = polygon;
38 	}
39 
40 }
41