Click or drag to resize

GeometryOffsetPolyline2d Method

Inflates or deflates polyline by delta units (pixels), producing polygons. If delta is positive, makes the polyline grow outward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. If delta is negative, returns an empty array.

Each polygon's vertices will be rounded as determined by join_type, see GeometryPolyJoinType.

Each polygon's endpoints will be rounded as determined by end_type, see GeometryPolyEndType.

The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling IsPolygonClockwise(Vector2).

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public static Array OffsetPolyline2d(
	Vector2[] polyline,
	float delta,
	GeometryPolyJoinType joinType = GeometryPolyJoinType.Square,
	GeometryPolyEndType endType = GeometryPolyEndType.Square
)

Parameters

polyline
Type: GodotVector2

[Missing <param name="polyline"/> documentation for "M:Godot.Geometry.OffsetPolyline2d(Godot.Vector2[],System.Single,Godot.Geometry.PolyJoinType,Godot.Geometry.PolyEndType)"]

delta
Type: SystemSingle

[Missing <param name="delta"/> documentation for "M:Godot.Geometry.OffsetPolyline2d(Godot.Vector2[],System.Single,Godot.Geometry.PolyJoinType,Godot.Geometry.PolyEndType)"]

joinType (Optional)
Type: GodotGeometryPolyJoinType

[Missing <param name="joinType"/> documentation for "M:Godot.Geometry.OffsetPolyline2d(Godot.Vector2[],System.Single,Godot.Geometry.PolyJoinType,Godot.Geometry.PolyEndType)"]

endType (Optional)
Type: GodotGeometryPolyEndType

[Missing <param name="endType"/> documentation for "M:Godot.Geometry.OffsetPolyline2d(Godot.Vector2[],System.Single,Godot.Geometry.PolyJoinType,Godot.Geometry.PolyEndType)"]

Return Value

Type: Array

[Missing <returns> documentation for "M:Godot.Geometry.OffsetPolyline2d(Godot.Vector2[],System.Single,Godot.Geometry.PolyJoinType,Godot.Geometry.PolyEndType)"]

See Also