On the draggable examples page we have this:
# Enable draggingtopScreen.draggable.enabled = truetopScreen.draggable.speedY = 0
# Prevent dragging lefttopScreen.draggable.maxDragFrame = topScreen.frametopScreen.draggable.maxDragFrame.width *= 2
which allows dragging from left to right. I'm trying to figure out the logic here so that I can switch the functionality to:
— allow drag from right to left— disable left to right
Any ideas that would help? Thanks a ton!
topScreen.on Events.DragMove, (e, layer) -> topScreen.draggable.maxDragFrame.x = layer.xjust a trick. but need to handle maxDragFrame.width in event, coz maxX(x+width) is moved accordingly x
or you can just add a line of code in that example. topScreen.draggable.maxDragFrame.x = topScreen.x-topScreen.width
Awesome thanks Min-Sang Choi. Anyone have any ideas about what I would do if I wanted to add these properties to multiple layers? Something like `draggableLayers = topScreen, bottomScreen`, then something like `draggableLayers.draggable.enabled = true`? Thanks for any ideas!