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