Line2D

package
v0.0.0-...-d9f4d4e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package Line2D provides methods for working with Line2D object instances.

Index

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 Any

type Any interface {
	gd.IsClass
	AsLine2D() Instance
}

type Instance

type Instance [1]gdclass.Line2D

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 New

func New() Instance

func (Instance) AddPoint

func (self Instance) AddPoint(position Vector2.XY)

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 (self Instance) Antialiased() bool

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsLine2D

func (self Instance) AsLine2D() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode2D

func (self Instance) AsNode2D() Node2D.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

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) Closed

func (self Instance) Closed() bool

func (Instance) DefaultColor

func (self Instance) DefaultColor() Color.RGBA

func (Instance) EndCapMode

func (self Instance) EndCapMode() gdclass.Line2DLineCapMode

func (Instance) GetPointCount

func (self Instance) GetPointCount() int

Returns the number of points in the polyline.

func (Instance) GetPointPosition

func (self Instance) GetPointPosition(index int) Vector2.XY

Returns the position of the point at index [param index].

func (Instance) Gradient

func (self Instance) Gradient() [1]gdclass.Gradient

func (Instance) JointMode

func (self Instance) JointMode() gdclass.Line2DLineJointMode

func (Instance) Points

func (self Instance) Points() []Vector2.XY

func (Instance) RemovePoint

func (self Instance) RemovePoint(index int)

Removes the point at index [param index] from the polyline.

func (Instance) RoundPrecision

func (self Instance) RoundPrecision() int

func (Instance) SetAntialiased

func (self Instance) SetAntialiased(value bool)

func (Instance) SetBeginCapMode

func (self Instance) SetBeginCapMode(value gdclass.Line2DLineCapMode)

func (Instance) SetClosed

func (self Instance) SetClosed(value bool)

func (Instance) SetDefaultColor

func (self Instance) SetDefaultColor(value Color.RGBA)

func (Instance) SetEndCapMode

func (self Instance) SetEndCapMode(value gdclass.Line2DLineCapMode)

func (Instance) SetGradient

func (self Instance) SetGradient(value [1]gdclass.Gradient)

func (Instance) SetJointMode

func (self Instance) SetJointMode(value gdclass.Line2DLineJointMode)

func (Instance) SetPointPosition

func (self Instance) SetPointPosition(index int, position Vector2.XY)

Overwrites the position of the point at the given [param index] with the supplied [param position].

func (Instance) SetPoints

func (self Instance) SetPoints(value []Vector2.XY)

func (Instance) SetRoundPrecision

func (self Instance) SetRoundPrecision(value int)

func (Instance) SetSharpLimit

func (self Instance) SetSharpLimit(value Float.X)

func (Instance) SetTexture

func (self Instance) SetTexture(value [1]gdclass.Texture2D)

func (Instance) SetTextureMode

func (self Instance) SetTextureMode(value gdclass.Line2DLineTextureMode)

func (Instance) SetWidth

func (self Instance) SetWidth(value Float.X)

func (Instance) SetWidthCurve

func (self Instance) SetWidthCurve(value [1]gdclass.Curve)

func (Instance) SharpLimit

func (self Instance) SharpLimit() Float.X

func (Instance) Texture

func (self Instance) Texture() [1]gdclass.Texture2D

func (Instance) TextureMode

func (self Instance) TextureMode() gdclass.Line2DLineTextureMode

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

func (Instance) Width

func (self Instance) Width() Float.X

func (Instance) WidthCurve

func (self Instance) WidthCurve() [1]gdclass.Curve

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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL