A 2D polygon.
    public class Polygon2D : Node2D

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.

Inheritance Chain

Constructors

    public Polygon2D()

Properties

    public bool Antialiased { get; set; }

If true, polygon edges will be anti-aliased.

    public Collections.Array Bones { get; set; }

    public Color Color { get; set; }

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.

    public int InternalVertexCount { get; set; }

    public float InvertBorder { get; set; }

Added padding applied to the bounding box when using invert. Setting this value too small may result in a “Bad Polygon” error.

    public bool InvertEnable { get; set; }

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

    public Vector2 Offset { get; set; }

The offset applied to each vertex.

    public Vector2[] Polygon { get; set; }

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

Note: This returns a copy of the PoolVector2Array rather than a reference.

    public Collections.Array Polygons { get; set; }

    public NodePath Skeleton { get; set; }

    public Texture Texture { get; set; }

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

    public Vector2 TextureOffset { get; set; }

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.

    public float TextureRotation { get; set; }

The texture’s rotation in radians.

    public float TextureRotationDegrees { get; set; }

The texture’s rotation in degrees.

    public Vector2 TextureScale { get; set; }

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

    public Vector2[] Uv { get; set; }

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

    public Color[] VertexColors { get; set; }

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.

Methods

    public void AddBone(NodePath path, float[] weights)

    public void ClearBones()

    public void EraseBone(int index)

    [Obsolete("GetAntialiased is deprecated. Use the Antialiased property instead.")]
    public bool GetAntialiased()

Getter for Antialiased

    public int GetBoneCount()

    public NodePath GetBonePath(int index)

    public float[] GetBoneWeights(int index)

    [Obsolete("GetColor is deprecated. Use the Color property instead.")]
    public Color GetColor()

Getter for Color

    [Obsolete("GetInternalVertexCount is deprecated. Use the InternalVertexCount property instead.")]
    public int GetInternalVertexCount()

Getter for InternalVertexCount

    [Obsolete("GetInvert is deprecated. Use the InvertEnable property instead.")]
    public bool GetInvert()

Getter for InvertEnable

    [Obsolete("GetInvertBorder is deprecated. Use the InvertBorder property instead.")]
    public float GetInvertBorder()

Getter for InvertBorder

    [Obsolete("GetOffset is deprecated. Use the Offset property instead.")]
    public Vector2 GetOffset()

Getter for Offset

    [Obsolete("GetPolygon is deprecated. Use the Polygon property instead.")]
    public Vector2[] GetPolygon()

Getter for Polygon

    [Obsolete("GetPolygons is deprecated. Use the Polygons property instead.")]
    public Godot.Collections.Array GetPolygons()

Getter for Polygons

    [Obsolete("GetSkeleton is deprecated. Use the Skeleton property instead.")]
    public NodePath GetSkeleton()

Getter for Skeleton

    [Obsolete("GetTexture is deprecated. Use the Texture property instead.")]
    public Texture GetTexture()

Getter for Texture

    [Obsolete("GetTextureOffset is deprecated. Use the TextureOffset property instead.")]
    public Vector2 GetTextureOffset()

Getter for TextureOffset

    [Obsolete("GetTextureRotation is deprecated. Use the TextureRotation property instead.")]
    public float GetTextureRotation()

Getter for TextureRotation

    [Obsolete("GetTextureRotationDegrees is deprecated. Use the TextureRotationDegrees property instead.")]
    public float GetTextureRotationDegrees()

Getter for TextureRotationDegrees

    [Obsolete("GetTextureScale is deprecated. Use the TextureScale property instead.")]
    public Vector2 GetTextureScale()

Getter for TextureScale

    [Obsolete("GetUv is deprecated. Use the Uv property instead.")]
    public Vector2[] GetUv()

Getter for Uv

    [Obsolete("GetVertexColors is deprecated. Use the VertexColors property instead.")]
    public Color[] GetVertexColors()

Getter for VertexColors

    [Obsolete("SetAntialiased is deprecated. Use the Antialiased property instead.")]
    public void SetAntialiased(bool antialiased)

Setter for Antialiased

    public void SetBonePath(int index, NodePath path)

    public void SetBoneWeights(int index, float[] weights)

    [Obsolete("SetColor is deprecated. Use the Color property instead.")]
    public void SetColor(Color color)

Setter for Color

    [Obsolete("SetInternalVertexCount is deprecated. Use the InternalVertexCount property instead.")]
    public void SetInternalVertexCount(int internalVertexCount)

Setter for InternalVertexCount

    [Obsolete("SetInvert is deprecated. Use the InvertEnable property instead.")]
    public void SetInvert(bool invert)

Setter for InvertEnable

    [Obsolete("SetInvertBorder is deprecated. Use the InvertBorder property instead.")]
    public void SetInvertBorder(float invertBorder)

Setter for InvertBorder

    [Obsolete("SetOffset is deprecated. Use the Offset property instead.")]
    public void SetOffset(Vector2 offset)

Setter for Offset

    [Obsolete("SetPolygon is deprecated. Use the Polygon property instead.")]
    public void SetPolygon(Vector2[] polygon)

Setter for Polygon

    [Obsolete("SetPolygons is deprecated. Use the Polygons property instead.")]
    public void SetPolygons(Godot.Collections.Array polygons)

Setter for Polygons

    [Obsolete("SetSkeleton is deprecated. Use the Skeleton property instead.")]
    public void SetSkeleton(NodePath skeleton)

Setter for Skeleton

    [Obsolete("SetTexture is deprecated. Use the Texture property instead.")]
    public void SetTexture(Texture texture)

Setter for Texture

    [Obsolete("SetTextureOffset is deprecated. Use the TextureOffset property instead.")]
    public void SetTextureOffset(Vector2 textureOffset)

Setter for TextureOffset

    [Obsolete("SetTextureRotation is deprecated. Use the TextureRotation property instead.")]
    public void SetTextureRotation(float textureRotation)

Setter for TextureRotation

    [Obsolete("SetTextureRotationDegrees is deprecated. Use the TextureRotationDegrees property instead.")]
    public void SetTextureRotationDegrees(float textureRotation)

Setter for TextureRotationDegrees

    [Obsolete("SetTextureScale is deprecated. Use the TextureScale property instead.")]
    public void SetTextureScale(Vector2 textureScale)

Setter for TextureScale

    [Obsolete("SetUv is deprecated. Use the Uv property instead.")]
    public void SetUv(Vector2[] uv)

Setter for Uv

    [Obsolete("SetVertexColors is deprecated. Use the VertexColors property instead.")]
    public void SetVertexColors(Color[] vertexColors)

Setter for VertexColors

Tags: