Struct Line2D
A 2D line.
struct Line2D
;
A line through several points in 2D space.
Properties
Name | Type | Description |
---|---|---|
antialiased [get, set]
|
bool | If true , the line's border will be anti-aliased.
|
beginCapMode [get, set]
|
Line2D | Controls the style of the line's first point. Use linecapmode constants.
|
defaultColor [get, set]
|
Color | The line's color. Will not be used if a gradient is set. |
endCapMode [get, set]
|
Line2D | Controls the style of the line's last point. Use linecapmode constants.
|
gradient [get, set]
|
Gradient | The gradient is drawn through the whole line from start to finish. The default color will not be used if a gradient is set. |
jointMode [get, set]
|
Line2D | The style for the points between the start and the end. |
points [get, set]
|
PoolArray!(godot.core.vector2.Vector2) | The points that form the lines. The line is drawn between every point set in this array. |
roundPrecision [get, set]
|
long | The smoothness of the rounded joints and caps. This is only used if a cap or joint is set as round. |
sharpLimit [get, set]
|
double | The direction difference in radians between vector points. This value is only used if joint mode is set to constant LINE_JOINT_SHARP .
|
texture [get, set]
|
Texture | The texture used for the line's texture. Uses texture_mode for drawing style.
|
textureMode [get, set]
|
Line2D | The style to render the texture on the line. Use linetexturemode constants.
|
width [get, set]
|
double | The line's width. |
widthCurve [get, set]
|
Curve | The line's width varies with the curve. The original width is simply multiply by the value of the Curve. |
Methods
Name | Description |
---|---|
_curveChanged
|
|
_gradientChanged
|
|
addPoint
|
Adds a point at the position . Appends the point at the end of the line.
If at_position is given, the point is inserted before the point number at_position , moving that point (and every point after) after the inserted point. If at_position is not given, or is an illegal value (at_position < 0 or at_position >= class="pln">D getPointCount ), the point will be appended at the end of the point list.
|
clearPoints
|
Removes all points from the line. |
getAntialiased
|
|
getBeginCapMode
|
|
getCurve
|
|
getDefaultColor
|
|
getEndCapMode
|
|
getGradient
|
|
getJointMode
|
|
getPointCount
|
Returns the Line2D's amount of points. |
getPointPosition
|
Returns point i 's position.
|
getPoints
|
|
getRoundPrecision
|
|
getSharpLimit
|
|
getTexture
|
|
getTextureMode
|
|
getWidth
|
|
removePoint
|
Removes the point at index i from the line.
|
setAntialiased
|
|
setBeginCapMode
|
|
setCurve
|
|
setDefaultColor
|
|
setEndCapMode
|
|
setGradient
|
|
setJointMode
|
|
setPointPosition
|
Overwrites the position in point i with the supplied position .
|
setPoints
|
|
setRoundPrecision
|
|
setSharpLimit
|
|
setTexture
|
|
setTextureMode
|
|
setWidth
|
Enums
Name | Description |
---|---|
Constants
|
|
LineCapMode
|
|
LineJointMode
|
|
LineTextureMode
|