Nifty drag n drop anywhere


#1

Seems that dragging and dropping a control anywhere you want in nifty is some sort of top secret shit or not possible.

I have read everything under the sun about this and cant get it to work.

In its most simplistic form one would expect all you need do is create a simple droppable that is the same size as the screen and a simple draggable the size you want it to be and be done with it.

However, this simple approach results in the draggable always centering in the droppable, whether or not you use absolute layout, whether you use a panel for one or both, different layers for each or none of the afore mentioned ways and just use a draggable and droppable inside a layer.

So, is it even possible to size a droppable as large as the screen and drop anything onto it anywhere you want?

if so, please feel free to enlighten me.


#2

There’s a Boolean for revert which you want to set to false. But if you want to drop anywhere then I’m not sure you even need a droppable.


#3

That made the difference, no droppable works. Thank you.


#4

That type of functionality isn’t really what dropable does. Dropable assume that you have set slots which you are dragging between. You wouldn’t have to implement it in a different way if you want to drag and drop anywhere. It probably wouldn’t be too hard to implement a control that uses a mouse movement / click callback to change the target elements x / y position with an absolute child layout parent.