Polygon2D

package
v0.0.0-...-a66c66c Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package Polygon2D provides methods for working with Polygon2D 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
	AsPolygon2D() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsCanvasItem

func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsNode2D

func (self *Extension[T]) AsNode2D() Node2D.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsPolygon2D

func (self *Extension[T]) AsPolygon2D() Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.Polygon2D

A Polygon2D is defined by a set of points. Each point is connected to the next, with the final point being connected to the first, resulting in a closed polygon. Polygon2Ds can be filled with color (solid or gradient) or filled with a given texture.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AddBone

func (self Instance) AddBone(path string, weights []float32)

Adds a bone with the specified [param path] and [param weights].

func (Instance) Antialiased

func (self Instance) Antialiased() bool

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.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) AsPolygon2D

func (self Instance) AsPolygon2D() Instance

func (Instance) ClearBones

func (self Instance) ClearBones()

Removes all bones from this [Polygon2D].

func (Instance) Color

func (self Instance) Color() Color.RGBA

func (Instance) EraseBone

func (self Instance) EraseBone(index int)

Removes the specified bone from this [Polygon2D].

func (Instance) GetBoneCount

func (self Instance) GetBoneCount() int

Returns the number of bones in this [Polygon2D].

func (Instance) GetBonePath

func (self Instance) GetBonePath(index int) string

Returns the path to the node associated with the specified bone.

func (Instance) GetBoneWeights

func (self Instance) GetBoneWeights(index int) []float32

Returns the weight values of the specified bone.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) InternalVertexCount

func (self Instance) InternalVertexCount() int

func (Instance) InvertBorder

func (self Instance) InvertBorder() Float.X

func (Instance) InvertEnabled

func (self Instance) InvertEnabled() bool

func (Instance) Offset

func (self Instance) Offset() Vector2.XY

func (Instance) Polygon

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

func (Instance) Polygons

func (self Instance) Polygons() []any

func (Instance) SetAntialiased

func (self Instance) SetAntialiased(value bool)

func (Instance) SetBonePath

func (self Instance) SetBonePath(index int, path string)

Sets the path to the node associated with the specified bone.

func (Instance) SetBoneWeights

func (self Instance) SetBoneWeights(index int, weights []float32)

Sets the weight values for the specified bone.

func (Instance) SetColor

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

func (Instance) SetInternalVertexCount

func (self Instance) SetInternalVertexCount(value int)

func (Instance) SetInvertBorder

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

func (Instance) SetInvertEnabled

func (self Instance) SetInvertEnabled(value bool)

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetOffset

func (self Instance) SetOffset(value Vector2.XY)

func (Instance) SetPolygon

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

func (Instance) SetPolygons

func (self Instance) SetPolygons(value []any)

func (Instance) SetSkeleton

func (self Instance) SetSkeleton(value string)

func (Instance) SetTexture

func (self Instance) SetTexture(value Texture2D.Instance)

func (Instance) SetTextureOffset

func (self Instance) SetTextureOffset(value Vector2.XY)

func (Instance) SetTextureRotation

func (self Instance) SetTextureRotation(value Angle.Radians)

func (Instance) SetTextureScale

func (self Instance) SetTextureScale(value Vector2.XY)

func (Instance) SetUv

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

func (Instance) SetVertexColors

func (self Instance) SetVertexColors(value []Color.RGBA)

func (Instance) Skeleton

func (self Instance) Skeleton() string

func (Instance) Texture

func (self Instance) Texture() Texture2D.Instance

func (Instance) TextureOffset

func (self Instance) TextureOffset() Vector2.XY

func (Instance) TextureRotation

func (self Instance) TextureRotation() Angle.Radians

func (Instance) TextureScale

func (self Instance) TextureScale() Vector2.XY

func (Instance) Uv

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

func (Instance) VertexColors

func (self Instance) VertexColors() []Color.RGBA

func (Instance) Virtual

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

Jump to

Keyboard shortcuts

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