Documentation
¶
Overview ¶
Package Line2D provides methods for working with Line2D object instances.
Index ¶
- type Advanced
- type Any
- type Instance
- func (self Instance) AddPoint(position Vector2.XY)
- func (self Instance) Antialiased() bool
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsLine2D() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode2D() Node2D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) BeginCapMode() gdclass.Line2DLineCapMode
- func (self Instance) ClearPoints()
- func (self Instance) Closed() bool
- func (self Instance) DefaultColor() Color.RGBA
- func (self Instance) EndCapMode() gdclass.Line2DLineCapMode
- func (self Instance) GetPointCount() int
- func (self Instance) GetPointPosition(index int) Vector2.XY
- func (self Instance) Gradient() [1]gdclass.Gradient
- func (self Instance) JointMode() gdclass.Line2DLineJointMode
- func (self Instance) Points() []Vector2.XY
- func (self Instance) RemovePoint(index int)
- func (self Instance) RoundPrecision() int
- func (self Instance) SetAntialiased(value bool)
- func (self Instance) SetBeginCapMode(value gdclass.Line2DLineCapMode)
- func (self Instance) SetClosed(value bool)
- func (self Instance) SetDefaultColor(value Color.RGBA)
- func (self Instance) SetEndCapMode(value gdclass.Line2DLineCapMode)
- func (self Instance) SetGradient(value [1]gdclass.Gradient)
- func (self Instance) SetJointMode(value gdclass.Line2DLineJointMode)
- func (self Instance) SetPointPosition(index int, position Vector2.XY)
- func (self Instance) SetPoints(value []Vector2.XY)
- func (self Instance) SetRoundPrecision(value int)
- func (self Instance) SetSharpLimit(value Float.X)
- func (self Instance) SetTexture(value [1]gdclass.Texture2D)
- func (self Instance) SetTextureMode(value gdclass.Line2DLineTextureMode)
- func (self Instance) SetWidth(value Float.X)
- func (self Instance) SetWidthCurve(value [1]gdclass.Curve)
- func (self Instance) SharpLimit() Float.X
- func (self Instance) Texture() [1]gdclass.Texture2D
- func (self Instance) TextureMode() gdclass.Line2DLineTextureMode
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
- func (self Instance) Width() Float.X
- func (self Instance) WidthCurve() [1]gdclass.Curve
- type LineCapMode
- type LineJointMode
- type LineTextureMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Instance ¶
This node draws a 2D polyline, i.e. a shape consisting of several points connected by segments. [Line2D] is not a mathematical polyline, i.e. the segments are not infinitely thin. It is intended for rendering and it can be colored and optionally textured. [b]Warning:[/b] Certain configurations may be impossible to draw nicely, such as very sharp angles. In these situations, the node uses fallback drawing logic to look decent. [b]Note:[/b] [Line2D] is drawn using a 2D mesh.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddPoint ¶
Adds a point with the specified [param position] relative to the polyline's own position. If no [param index] is provided, the new point will be added to the end of the points array. If [param index] is given, the new point is inserted before the existing point identified by index [param index]. The indices of the points after the new point get increased by 1. The provided [param index] must not exceed the number of existing points in the polyline. See [method get_point_count].
func (Instance) Antialiased ¶
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) BeginCapMode ¶
func (self Instance) BeginCapMode() gdclass.Line2DLineCapMode
func (Instance) ClearPoints ¶
func (self Instance) ClearPoints()
Removes all points from the polyline, making it empty.
func (Instance) DefaultColor ¶
func (Instance) EndCapMode ¶
func (self Instance) EndCapMode() gdclass.Line2DLineCapMode
func (Instance) GetPointCount ¶
Returns the number of points in the polyline.
func (Instance) GetPointPosition ¶
Returns the position of the point at index [param index].
func (Instance) JointMode ¶
func (self Instance) JointMode() gdclass.Line2DLineJointMode
func (Instance) RemovePoint ¶
Removes the point at index [param index] from the polyline.
func (Instance) RoundPrecision ¶
func (Instance) SetAntialiased ¶
func (Instance) SetBeginCapMode ¶
func (self Instance) SetBeginCapMode(value gdclass.Line2DLineCapMode)
func (Instance) SetDefaultColor ¶
func (Instance) SetEndCapMode ¶
func (self Instance) SetEndCapMode(value gdclass.Line2DLineCapMode)
func (Instance) SetGradient ¶
func (Instance) SetJointMode ¶
func (self Instance) SetJointMode(value gdclass.Line2DLineJointMode)
func (Instance) SetPointPosition ¶
Overwrites the position of the point at the given [param index] with the supplied [param position].
func (Instance) SetRoundPrecision ¶
func (Instance) SetSharpLimit ¶
func (Instance) SetTexture ¶
func (Instance) SetTextureMode ¶
func (self Instance) SetTextureMode(value gdclass.Line2DLineTextureMode)
func (Instance) SetWidthCurve ¶
func (Instance) SharpLimit ¶
func (Instance) TextureMode ¶
func (self Instance) TextureMode() gdclass.Line2DLineTextureMode
func (*Instance) UnsafePointer ¶
func (Instance) WidthCurve ¶
type LineCapMode ¶
type LineCapMode = gdclass.Line2DLineCapMode //gd:Line2D.LineCapMode
const ( /*Draws no line cap.*/ LineCapNone LineCapMode = 0 /*Draws the line cap as a box, slightly extending the first/last segment.*/ LineCapBox LineCapMode = 1 /*Draws the line cap as a semicircle attached to the first/last segment.*/ LineCapRound LineCapMode = 2 )
type LineJointMode ¶
type LineJointMode = gdclass.Line2DLineJointMode //gd:Line2D.LineJointMode
const ( /*Makes the polyline's joints pointy, connecting the sides of the two segments by extending them until they intersect. If the rotation of a joint is too big (based on [member sharp_limit]), the joint falls back to [constant LINE_JOINT_BEVEL] to prevent very long miters.*/ LineJointSharp LineJointMode = 0 /*Makes the polyline's joints bevelled/chamfered, connecting the sides of the two segments with a simple line.*/ LineJointBevel LineJointMode = 1 /*Makes the polyline's joints rounded, connecting the sides of the two segments with an arc. The detail of this arc depends on [member round_precision].*/ LineJointRound LineJointMode = 2 )
type LineTextureMode ¶
type LineTextureMode = gdclass.Line2DLineTextureMode //gd:Line2D.LineTextureMode
const ( /*Takes the left pixels of the texture and renders them over the whole polyline.*/ LineTextureNone LineTextureMode = 0 /*Tiles the texture over the polyline. [member CanvasItem.texture_repeat] of the [Line2D] node must be [constant CanvasItem.TEXTURE_REPEAT_ENABLED] or [constant CanvasItem.TEXTURE_REPEAT_MIRROR] for it to work properly.*/ LineTextureTile LineTextureMode = 1 /*Stretches the texture across the polyline. [member CanvasItem.texture_repeat] of the [Line2D] node must be [constant CanvasItem.TEXTURE_REPEAT_DISABLED] for best results.*/ LineTextureStretch LineTextureMode = 2 )