Framework

Spatial Path and Edge

Import Path and Edge from bedform/Spatial/Components and place them inside a spatial View. Points use the widget's top-left corner as the origin, with X increasing right and Y increasing down. Supply two points for a line, three for a quadratic Bézier, or four for a cubic Bézier.

<Path
    Width={100}
    Height={52}
    Thickness={2}
    Color="#78BCD8"
    Points={[{ X: 6, Y: 42 }, { X: 50, Y: 6 }, { X: 94, Y: 42 }]}
/>
<Edge
    Width={120}
    Height={64}
    Thickness={2}
    Color="#F8D66D"
    Points={[{ X: 8, Y: 48 }, { X: 34, Y: 2 }, { X: 64, Y: 56 }, { X: 105, Y: 20 }]}
    OnEndpointChange={(point, playerId) => saveEndpoint(point, playerId)}
/>

Bedform selects an unlit cuboid rig from 1, 4, 8, 12, 16, 24, 32, 48, and 64 segments. Path uses a relaxed tolerance by default. Set Editing while changing a path's points to request finer tessellation. Edge always uses the finer tolerance and anticipates curvature across its drag area.

Path shows read-only particle lines and squares for the control polygon by default. Pass ShowControlPoints={false} to hide them. Edge hides them by default and can show the committed control polygon for debugging with ShowControlPoints. Pass the native MolangVariableMap constructor in the renderer's Native options to enable the guides.

For Edge, look at the arrowhead and press Use, then aim within the widget's box and press Use again to confirm. The native maximum reach is three blocks and a shorter Pointer.MaxDistance takes precedence. While selected, the preview follows the local client's camera each render frame. Sneak or step out of reach to cancel. A confirmed endpoint is shared with the root audience until the authored endpoint changes. Use OnEndpointChange to record the endpoint in application state.

The default arrowhead arm length is four times Thickness. Set ArrowSize in pixels to override it. Set Arrow={false} to hide the arrowhead and remove the endpoint handle, or Disabled to keep the arrowhead visible with editing disabled.