Skip to content
Roblox API Reference

Path2D

Represents a 2D cubic spline path that renders a stroked curve under any GuiObject.
Memory category
Instances
Own members
24
Inherited members
75
Subclasses
0
Siblings
3

Properties32

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Defined byPath2D9

Property categoryControl Points

  • Path2D.SelectedControlPoint: number = 1
    Index of the currently selected Path2DControlPoint.
    • Not replicated
    • Roblox script security
    • Read capabilities: UI
    • Load only
  • Path2D.SelectedControlPointData: Path2DControlPoint
    Path2DControlPoint data type representing the currently selected control point.
    • Not replicated
    • Roblox script security
    • Read capabilities: UI
    • Load only

Property categoryData

  • Path2D.Closed: boolean = false
    Connects the first and last control points when enabled.
    • Read capabilities: UI
  • Path2D.Color3: Color3 = Color3.new(0, 0, 0)
    Determines the color of the Path2D.
    • Read capabilities: UI
  • Path2D.PropertiesSerialize: string = ""
    • Hidden
    • Not scriptable
    • Roblox script security
    • Read capabilities: UI
  • Path2D.Thickness: number = 1
    Determines how thick the Path2D path is.
    • Read capabilities: UI
  • Path2D.Transparency: number = 0
    • Roblox script security
    • Read capabilities: UI
  • Path2D.Visible: boolean = true
    Determines if the Path2D path is rendered or not.
    • Read capabilities: UI
  • Path2D.ZIndex: number = 1
    Determines the order in which a Path2D path renders relative to other GUIs.
    • Read capabilities: UI

Methods56

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Inherited fromInstance39
Defined byPath2D14
  • Path2D:GetBoundingRect(): Rect
    Returns the bounding size for the Path2D.
    • Capabilities: UI
    Returns
    TypeDescription
    Rect
    The Rect bounding box that encloses the path, expanded by its rendered thickness.
  • Path2D:GetControlPoint(index: number): Path2DControlPoint
    Returns the Path2DControlPoint for a given index.
    • Capabilities: UI
    Parameters
    ParameterDescription
    index: number
    The 1-based index of the control point to return.
    Returns
    TypeDescription
    Path2DControlPoint
    The control point at the given index.
  • Path2D:GetControlPoints(): { any }
    Returns all the Path2DControlPoints for the Path2D.
    • Capabilities: UI
    Returns
    TypeDescription
    { any }
    Table of all the Path2DControlPoints.
  • Path2D:GetLength(): number
    Returns the length of the Path2D.
    • Capabilities: UI
    Returns
    TypeDescription
    number
    The total length of the path.
  • Path2D:GetMaxControlPoints(): number
    Returns the maximum allowed number of control points.
    • Capabilities: UI
    Returns
    TypeDescription
    number
    The maximum number of control points a Path2D supports.
  • Path2D:GetPositionOnCurve(t: number): UDim2
    Returns the position at a given value in parameter space.
    • Capabilities: UI
    Parameters
    ParameterDescription
    t: number
    The value to query the Path2D at.
    Returns
    TypeDescription
    UDim2
    The position in parameter space.
  • Path2D:GetPositionOnCurveArcLength(t: number): UDim2
    Returns the position at a given value in arc length space.
    • Capabilities: UI
    Parameters
    ParameterDescription
    t: number
    The value to query the Path2D at.
    Returns
    TypeDescription
    UDim2
    The position in arc length space.
  • Path2D:GetSegmentCount(): number
    • Roblox script security
    • Capabilities: UI
    Returns
    Type
    number
  • Path2D:GetTangentOnCurve(t: number): Vector2
    Returns the tangent at a given value in parameter space.
    • Capabilities: UI
    Parameters
    ParameterDescription
    t: number
    The value to query the Path2D at.
    Returns
    TypeDescription
    Vector2
    The tangent in parameter space.
  • Path2D:GetTangentOnCurveArcLength(t: number): Vector2
    Returns the tangent at a given value in arc length space.
    • Capabilities: UI
    Parameters
    ParameterDescription
    t: number
    The value to query the Path2D at.
    Returns
    TypeDescription
    Vector2
    The tangent in arc length space.
  • Path2D:InsertControlPoint(index: number, point: Path2DControlPoint)
    Inserts a new control point at a given index.
    • Capabilities: UI
    Parameters
    ParameterDescription
    index: number
    The index to insert at.
    point: Path2DControlPoint
    The control point to insert.
  • Path2D:RemoveControlPoint(index: number)
    Removes a control at the given index.
    • Capabilities: UI
    Parameters
    ParameterDescription
    index: number
    The index to remove at.
  • Path2D:SetControlPoints(controlPoints: { any })
    Sets all the control points to the specified array, replacing all existing points with new ones.
    • Capabilities: UI
    Parameters
    ParameterDescription
    controlPoints: { any }
    The new list of control points to set.
  • Path2D:UpdateControlPoint(index: number, point: Path2DControlPoint)
    Updates a control point at the given index.
    • Capabilities: UI
    Parameters
    ParameterDescription
    index: number
    The control point index to update.
    point: Path2DControlPoint
    The new Path2DControlPoint value to store at the index.

Events11

Inherited fromObject1
Inherited fromInstance9
Defined byPath2D1
  • Path2D.ControlPointChanged: RBXScriptSignal<()>
    Fires any time control points change.
    • Capabilities: UI