Capítulo 228 de 411

Chapter 228: Draggable.update()

Core Idea

Resynchronizes the Draggable's internal x/y with the target element's actual current position — needed if something outside Draggable moved/tweened the element directly.

Reference Tables

ParameterTypeDescription
applyBoundsBoolean (default false)if true, also re-enforces bounds via applyBounds() (costs more processing)
stickyBooleanif true, coordinates update so the element "sticks" to the pointer — useful when reparenting

Returns: the Draggable instance (chainable).

Key Takeaways

  1. A tween's onUpdate can point at this method to keep Draggable synced throughout an external animation.

Connects To

  • Draggable.x, Draggable.y, Draggable.rotation: the properties this method resynchronizes.