Struct Line2D

A 2D line.

struct Line2D ;

A line through several points in 2D space.

Properties

NameTypeDescription
antialiased[get, set] boolIf true, the line's border will be anti-aliased.
beginCapMode[get, set] Line2D.LineCapModeControls the style of the line's first point. Use linecapmode constants.
defaultColor[get, set] ColorThe line's color. Will not be used if a gradient is set.
endCapMode[get, set] Line2D.LineCapModeControls the style of the line's last point. Use linecapmode constants.
gradient[get, set] GradientThe 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.LineJointModeThe 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] longThe smoothness of the rounded joints and caps. This is only used if a cap or joint is set as round.
sharpLimit[get, set] doubleThe 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] TextureThe texture used for the line's texture. Uses texture_mode for drawing style.
textureMode[get, set] Line2D.LineTextureModeThe style to render the texture on the line. Use linetexturemode constants.
width[get, set] doubleThe line's width.
widthCurve[get, set] CurveThe line's width varies with the curve. The original width is simply multiply by the value of the Curve.

Methods

NameDescription
_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

NameDescription
Constants
LineCapMode
LineJointMode
LineTextureMode