Class Polygon
java.lang.Object
com.codingame.gameengine.module.entities.Entity<T>
com.codingame.gameengine.module.entities.BlendableEntity<T>
com.codingame.gameengine.module.entities.Shape<Polygon>
com.codingame.gameengine.module.entities.Polygon
- All Implemented Interfaces:
Mask
A Polygon specifies an area in a the world
defined by a sequence of points.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.codingame.gameengine.module.entities.BlendableEntity
BlendableEntity.BlendMode
-
Method Summary
Modifier and TypeMethodDescriptionaddPoint
(int x, int y) Adds a point to the path of thisPolygon
.Clears the path of thisPolygon
.setPointsInterpolationCurve
(Curve curve) Sets the transition used to animate the positions of each point.Methods inherited from class com.codingame.gameengine.module.entities.Shape
getFillAlpha, getFillColor, getLineAlpha, getLineColor, getLineWidth, setFillAlpha, setFillAlpha, setFillColor, setFillColor, setLineAlpha, setLineAlpha, setLineColor, setLineColor, setLineWidth, setLineWidth
Methods inherited from class com.codingame.gameengine.module.entities.BlendableEntity
getBlendMode, setBlendMode
Methods inherited from class com.codingame.gameengine.module.entities.Entity
getAlpha, getId, getMask, getParent, getRotation, getScaleX, getScaleY, getSkewX, getSkewY, getX, getY, getZIndex, isVisible, requireValidAlpha, requireValidColor, self, set, set, setAlpha, setAlpha, setMask, setMask, setRotation, setRotation, setScale, setScale, setScaleX, setScaleX, setScaleY, setScaleY, setSkewX, setSkewX, setSkewY, setSkewY, setVisible, setX, setX, setY, setY, setZIndex
-
Method Details
-
addPoint
Adds a point to the path of thisPolygon
.- Parameters:
x
- the x coordinate in world unitsy
- the x coordinate in world units- Returns:
- this
Polygon
-
clearPoints
Clears the path of thisPolygon
.- Returns:
- this
Polygon
-
setPointsInterpolationCurve
Sets the transition used to animate the positions of each point. Only used if the path has the same number of points.- Parameters:
curve
- the transition to animate between coordinates of each point in the path.- Returns:
- this
Polygon
-