Polygon¶
-
php\gdx\math\Polygon
Class Polygon
Methods
__construct
($vertices)¶
Параметры:
- $vertices –
array
- (optional)
getVertices
()¶Returns the polygon’s local vertices without scaling or rotation and without being offset by the polygon position.
Результат: float[]
getTransformedVertices
()¶
Результат: float[]
vertices scaled, rotated, and offset by the polygon position.
setOrigin
($originX, $originY)¶Sets the origin point to which all of the polygon’s local vertices are relative to.
Параметры:
- $originX –
float
- $originY –
float
setPosition
($x, $y)¶Sets the polygon’s position within the world.
Параметры:
- $x –
float
- $y –
float
setVertices
($vertices)¶
Параметры:
- $vertices –
array
translate
($x, $y)¶Translates the polygon’s position by the specified horizontal and vertical amounts.
Параметры:
- $x –
float
- $y –
float
setRotation
($degrees)¶Sets the polygon to be rotated by the supplied degrees.
Параметры:
- $degrees –
float
rotate
($degrees)¶Applies additional rotation to the polygon by the supplied degrees.
Параметры:
- $degrees –
float
setScale
($scaleX, $scaleY)¶Sets the amount of scaling to be applied to the polygon.
Параметры:
- $scaleX –
float
- $scaleY –
float
scale
($amount)¶Applies additional scaling to the polygon by the supplied amount.
Параметры:
- $amount –
float
dirty
()¶
area
()¶Returns the area contained within the polygon.
Результат: float
contains
($x, $y)¶
Параметры:
- $x –
float
- $y –
float
Результат:
bool
getX
()¶
Результат: float
getY
()¶
Результат: float
getOriginX
()¶
Результат: float
getOriginY
()¶
Результат: float
getRotation
()¶
Результат: float
getScaleX
()¶
Результат: float
getScaleY
()¶
Результат: float