mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Enhance draggable function documentation with options
Added detailed options for the draggable function, including axis constraints, smoothing, and drag event callbacks.
This commit is contained in:
parent
8d2847c4fa
commit
ef4c336650
1 changed files with 10 additions and 0 deletions
|
|
@ -64,15 +64,25 @@ Creates an Action that makes a GuiObject draggable using input events (mouse and
|
||||||
draggable(opts: DraggableOptions?) -> Action
|
draggable(opts: DraggableOptions?) -> Action
|
||||||
```
|
```
|
||||||
DraggableOptions
|
DraggableOptions
|
||||||
|
|
||||||
• axis: "x" | "y" | "both" (default "both")
|
• axis: "x" | "y" | "both" (default "both")
|
||||||
|
|
||||||
Constrains dragging to a single axis or allows free movement.
|
Constrains dragging to a single axis or allows free movement.
|
||||||
|
|
||||||
• smoothTime: number (optional, default 0)
|
• smoothTime: number (optional, default 0)
|
||||||
|
|
||||||
Enables smoothing/“weight” while dragging. 0 disables smoothing. Practical range: 0.05–0.12.
|
Enables smoothing/“weight” while dragging. 0 disables smoothing. Practical range: 0.05–0.12.
|
||||||
|
|
||||||
• onDragStart: (startPos: UDim2) -> () (optional)
|
• onDragStart: (startPos: UDim2) -> () (optional)
|
||||||
|
|
||||||
Called when dragging begins. Receives the starting Position.
|
Called when dragging begins. Receives the starting Position.
|
||||||
|
|
||||||
• onDrag: (newPos: UDim2) -> () (optional)
|
• onDrag: (newPos: UDim2) -> () (optional)
|
||||||
|
|
||||||
Called while dragging. Receives the updated Position.
|
Called while dragging. Receives the updated Position.
|
||||||
|
|
||||||
• onDragEnd: (endPos: UDim2) -> () (optional)
|
• onDragEnd: (endPos: UDim2) -> () (optional)
|
||||||
|
|
||||||
Called when dragging ends. Receives the final Position.
|
Called when dragging ends. Receives the final Position.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue