Reference API Roblox

Engine API

Website

Related

Reference API Roblox

Path2D

Member index 24

HistoryMember
634Closed: bool
621Color3: Color3
613SelectedControlPoint: int
616SelectedControlPointData: Path2DControlPoint
614Thickness: float
604Transparency: float
613Visible: bool
613ZIndex: int
621GetBoundingRect(): Rect
613GetControlPoint(index: int): Path2DControlPoint
613GetControlPoints(): Array
634GetLength(): float
634GetMaxControlPoints(): int
613GetPositionOnCurve(t: float): UDim2
613GetPositionOnCurveArcLength(t: float): UDim2
602GetSegmentCount(): int
613GetTangentOnCurve(t: float): Vector2
613GetTangentOnCurveArcLength(t: float): Vector2
613InsertControlPoint(index: int, point: Path2DControlPoint): null
613RemoveControlPoint(index: int): null
613SetControlPoints(controlPoints: Array): null
613UpdateControlPoint(index: int, point: Path2DControlPoint): null
634ControlPointChanged()
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Removed member index 7

HistoryMember
613AbsoluteSize: Vector2
621Color: Color3
616ControlPointLeftTangent: UDim2
616ControlPointPosition: UDim2
616ControlPointRightTangent: UDim2
621Position: UDim2
621GetBoundingRect2D(): Rect

Description

History 68

Members 24

Closed

TypeDefault
boolfalse

Connects the first and last control points when enabled.

History 1

Color3

TypeDefault
Color30, 0, 0

Determines the Color of the Path2D.

History 1

ControlPointChanged

Parameters (0)
No parameters.

Fires any time control points change.

History 1

GetBoundingRect

Parameters (0)
No parameters.
Returns (1)
Rect

Returns the Rect bounding size for the Path2D. This is computed based on the control points and is not modifiable outside of changing the control point data.

History 1

GetControlPoint

Parameters (1)
indexint
Returns (1)
Path2DControlPoint

Returns the Path2DControlPoint for a given index. If the index is out of bounds, this method will throw an error.

History 2

GetControlPoints

Parameters (0)
No parameters.
Returns (1)
Array

Returns a table of all the Path2DControlPoints for the Path2D.

History 2

GetLength

Parameters (0)
No parameters.
Returns (1)
float

Returns the length of the Path2D. This function can be expensive if called too frequently.

History 2

GetMaxControlPoints

Parameters (0)
No parameters.
Returns (1)
int

Returns the maximum allowed number of control points.

History 1

GetPositionOnCurve

Parameters (1)
tfloat
Returns (1)
UDim2

Returns the 2D UDim2 position at a given t value between 0 and 1 (inclusive), representing the parameter space result of querying the spline. The values will be more tightly packed near bends and wider apart in straighter segments; see GetPositionOnCurveArcLength() for even spacing results.

Throws an error if the Path2D has less than two control points.

History 2

GetPositionOnCurveArcLength

Parameters (1)
tfloat
Returns (1)
UDim2

Returns the 2D UDim2 position at a given t value between 0 and 1 (inclusive), representing the arc length space result of querying the spline. The values will be evenly spaced along the spline; see GetPositionOnCurve() for parameter spacing results.

Throws an error if the Path2D has less than two control points.

History 2

GetSegmentCount

Parameters (0)
No parameters.
Returns (1)
int

History 1

GetTangentOnCurve

Parameters (1)
tfloat
Returns (1)
Vector2

Returns the tangent at a given t value in parameter space where t is a value between 0 and 1 (inclusive). Throws an error if the Path2D has less than two control points.

History 2

GetTangentOnCurveArcLength

Parameters (1)
tfloat
Returns (1)
Vector2

Returns the tangent at a given t value in arc length space where t is a value between 0 and 1 (inclusive). Throws an error if the Path2D has less than two control points.

History 2

InsertControlPoint

Parameters (2)
indexint
pointPath2DControlPoint
Returns (1)
null

Inserts a new Path2DControlPoint at a given index. Throws a warning if the index is out of bounds or if you're trying to add control points past the limit of 50.

History 2

RemoveControlPoint

Parameters (1)
indexint
Returns (1)
null

Removes a control point at the given index. Throws a warning if the index is out of bounds.

History 2

SelectedControlPoint

TypeDefault
int1
This property is not replicated. Its interface does not cross the network boundary.

History 2

Tags: [NotReplicated]

SelectedControlPointData

TypeDefault
Path2DControlPoint
This property is not replicated. Its interface does not cross the network boundary.

History 1

Tags: [NotReplicated]

SetControlPoints

Parameters (1)
controlPointsArray
Returns (1)
null

Sets all the control points to the specified array, replacing all existing points with new ones. Throws a warning if there are more than 50 points in the controlPoints array.

History 2

Thickness

TypeDefault
float1

Determines how thick the Path2D path is.

History 3

Transparency

TypeDefault
float0

History 3

UpdateControlPoint

Parameters (2)
indexint
pointPath2DControlPoint
Returns (1)
null

Updates the control point at the given index. Throws a warning if the index is out of range.

History 2

Visible

TypeDefault
booltrue

Determines if the Path2D path is rendered or not. When false, the path will not render. However, any modifications to the control points will update correctly, ensuring that querying data will have the correct info.

History 4

  • 613 Change WriteSecurity of Visible from RobloxScriptSecurity to None
  • 613 Change ReadSecurity of Visible from RobloxScriptSecurity to None
  • 602 Change Category of Visible from Appearance to Data
  • 601 Add Visible

ZIndex

TypeDefault
int1

Determines the order in which a Path2D path renders relative to other GUIs. Works the same as GuiObject.ZIndex but does not interact with layout order in any way.

History 3

  • 613 Change ReadSecurity of ZIndex from RobloxScriptSecurity to None
  • 613 Change WriteSecurity of ZIndex from RobloxScriptSecurity to None
  • 610 Add ZIndex

Removed members 7

AbsoluteSize

TypeDefault
Vector20, 0
This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 2

Tags: [ReadOnly, NotReplicated]

Color

TypeDefault
Color30, 0, 0

History 4

  • 621 Remove Color
  • 613 Change WriteSecurity of Color from RobloxScriptSecurity to None
  • 613 Change ReadSecurity of Color from RobloxScriptSecurity to None
  • 602 Add Color

ControlPointLeftTangent

TypeDefault
UDim2{0, 0}, {0, 0}
This property is not replicated. Its interface does not cross the network boundary.

History 2

Tags: [NotReplicated]

ControlPointPosition

TypeDefault
UDim2{0, 0}, {0, 0}
This property is not replicated. Its interface does not cross the network boundary.

History 2

Tags: [NotReplicated]

ControlPointRightTangent

TypeDefault
UDim2{0, 0}, {0, 0}
This property is not replicated. Its interface does not cross the network boundary.

History 2

Tags: [NotReplicated]

GetBoundingRect2D

Parameters (0)
No parameters.
Returns (1)
Rect

History 2

Position

TypeDefault
UDim2{0, 0}, {0, 0}

History 4

Settings