Defines a 2D collision polygon.
    public class CollisionPolygon2D : Node2D

Provides a 2D collision polygon to a CollisionObject2D parent. Polygon can be drawn in the editor or specified by a list of vertices.

Inheritance Chain

Constructors

    public CollisionPolygon2D()

Properties

    public BuildModeEnum BuildMode { get; set; }

Collision build mode. Use one of the BUILD_* constants.

    public bool Disabled { get; set; }

If true, no collisions will be detected.

    public bool OneWayCollision { get; set; }

If true, only edges that face up, relative to CollisionPolygon2D’s rotation, will collide with other objects.

    public float OneWayCollisionMargin { get; set; }

    public Vector2[] Polygon { get; set; }

The polygon’s list of vertices. The final point will be connected to the first. The returned value is a clone of the PoolVector2Array, not a reference.

Methods

    [Obsolete("GetBuildMode is deprecated. Use the BuildMode property instead.")]
    public BuildModeEnum GetBuildMode()

Getter for BuildMode

    [Obsolete("GetOneWayCollisionMargin is deprecated. Use the OneWayCollisionMargin property instead.")]
    public float GetOneWayCollisionMargin()

Getter for OneWayCollisionMargin

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

Getter for Polygon

    [Obsolete("IsDisabled is deprecated. Use the Disabled property instead.")]
    public bool IsDisabled()

Getter for Disabled

    [Obsolete("IsOneWayCollisionEnabled is deprecated. Use the OneWayCollision property instead.")]
    public bool IsOneWayCollisionEnabled()

Getter for OneWayCollision

    [Obsolete("SetBuildMode is deprecated. Use the BuildMode property instead.")]
    public void SetBuildMode(BuildModeEnum buildMode)

Setter for BuildMode

    [Obsolete("SetDisabled is deprecated. Use the Disabled property instead.")]
    public void SetDisabled(bool disabled)

Setter for Disabled

    [Obsolete("SetOneWayCollision is deprecated. Use the OneWayCollision property instead.")]
    public void SetOneWayCollision(bool enabled)

Setter for OneWayCollision

    [Obsolete("SetOneWayCollisionMargin is deprecated. Use the OneWayCollisionMargin property instead.")]
    public void SetOneWayCollisionMargin(float margin)

Setter for OneWayCollisionMargin

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

Setter for Polygon

Inner Types

BuildModeEnum

Name Value Description
Solids    
Segments    
Tags: