Polygon2D

A 2D polygon.

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.

@GodotBaseClass
struct Polygon2D {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

_getBones
Array _getBones()
_setBones
void _setBones(Array bones)
addBone
void addBone(NodePathArg0 path, PoolRealArray weights)
clearBones
void clearBones()
eraseBone
void eraseBone(long index)
getAntialiased
bool getAntialiased()
getBoneCount
long getBoneCount()
getBonePath
NodePath getBonePath(long index)
getBoneWeights
PoolRealArray getBoneWeights(long index)
getColor
Color getColor()
getInvert
bool getInvert()
getInvertBorder
double getInvertBorder()
getOffset
Vector2 getOffset()
getPolygon
PoolVector2Array getPolygon()
getSkeleton
NodePath getSkeleton()
getSplits
PoolIntArray getSplits()
getTexture
Ref!Texture getTexture()
getTextureOffset
Vector2 getTextureOffset()
getTextureRotation
double getTextureRotation()
getTextureRotationDegrees
double getTextureRotationDegrees()
getTextureScale
Vector2 getTextureScale()
getUv
PoolVector2Array getUv()
getVertexColors
PoolColorArray getVertexColors()
opAssign
Polygon2D opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Polygon2D other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
setAntialiased
void setAntialiased(bool antialiased)
setBonePath
void setBonePath(long index, NodePathArg1 path)
setBoneWeights
void setBoneWeights(long index, PoolRealArray weights)
setColor
void setColor(Color color)
setInvert
void setInvert(bool invert)
setInvertBorder
void setInvertBorder(double invert_border)
setOffset
void setOffset(Vector2 offset)
setPolygon
void setPolygon(PoolVector2Array polygon)
setSkeleton
void setSkeleton(NodePathArg0 skeleton)
setSplits
void setSplits(PoolIntArray splits)
setTexture
void setTexture(Texture texture)
setTextureOffset
void setTextureOffset(Vector2 texture_offset)
setTextureRotation
void setTextureRotation(double texture_rotation)
setTextureRotationDegrees
void setTextureRotationDegrees(double texture_rotation)
setTextureScale
void setTextureScale(Vector2 texture_scale)
setUv
void setUv(PoolVector2Array uv)
setVertexColors
void setVertexColors(PoolColorArray vertex_colors)

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

antialiased
bool antialiased [@property getter]
bool antialiased [@property setter]

If true polygon edges will be anti-aliased. Default value: false.

bones
Array bones [@property getter]
Array bones [@property setter]
color
Color color [@property getter]
Color color [@property setter]

The polygon's fill color. If texture is defined, it will be multiplied by this color. It will also be the default color for vertices not set in vertex_colors.

invertBorder
double invertBorder [@property getter]
double invertBorder [@property setter]

Added padding applied to the bounding box when using invert. Setting this value too small may result in a "Bad Polygon" error. Default value: 100.

invertEnable
bool invertEnable [@property getter]
bool invertEnable [@property setter]

If true polygon will be inverted, containing the area outside the defined points and extending to the invert_border. Default value: false.

offset
Vector2 offset [@property getter]
Vector2 offset [@property setter]

The offset applied to each vertex.

polygon
PoolVector2Array polygon [@property getter]
PoolVector2Array polygon [@property setter]

The polygon's list of vertices. The final point will be connected to the first.

skeleton
NodePath skeleton [@property getter]
NodePath skeleton [@property setter]
splits
PoolIntArray splits [@property getter]
PoolIntArray splits [@property setter]
texture
Texture texture [@property getter]
Texture texture [@property setter]

The polygon's fill texture. Use uv to set texture coordinates.

textureOffset
Vector2 textureOffset [@property getter]
Vector2 textureOffset [@property setter]

Amount to offset the polygon's texture. If (0, 0) the texture's origin (its top-left corner) will be placed at the polygon's position.

textureRotation
double textureRotation [@property getter]
double textureRotation [@property setter]

The texture's rotation in radians.

textureRotationDegrees
double textureRotationDegrees [@property getter]
double textureRotationDegrees [@property setter]

The texture's rotation in degrees.

textureScale
Vector2 textureScale [@property getter]
Vector2 textureScale [@property setter]

Amount to multiply the uv coordinates when using a texture. Larger values make the texture smaller, and vice versa.

uv
PoolVector2Array uv [@property getter]
PoolVector2Array uv [@property setter]

Texture coordinates for each vertex of the polygon. There should be one uv per polygon vertex. If there are fewer, undefined vertices will use (0, 0).

vertexColors
PoolColorArray vertexColors [@property getter]
PoolColorArray vertexColors [@property setter]

Color for each vertex. Colors are interpolated between vertices, resulting in smooth gradients. There should be one per polygon vertex. If there are fewer, undefined vertices will use color.

Static functions

_new
Polygon2D _new()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

_classBinding
struct _classBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
ToRef as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta