Dragging items (like, REALLY dragging)

  • #1, by BarneyThursday, 08. January 2015, 16:51 10 years ago
    OK, this might sound like a silly question, but bear with me: Is there a way to implement a drag-and-drop kind of interface when using inventory items? You know, not the "click the item, then click the object to use the item", but the one-touch-dragging method (of the games that do this, Broken Age comes to mind).
    I thought this kind of interface might be more suitable for touch screen devices.


    42 Posts

  • #2, by afrlmeThursday, 08. January 2015, 17:26 10 years ago
    I believe that some gestures & swipe actions are being worked on for the upcoming release or a future release for mobile specific actions.

    As for your question... I reckon it would be possible to implement yourself by adding a button hold action to each of the items in which you set item (tick item dragged) & then in the game tab > mouse properties in mouse release action add something like:
    -- these are action parts not lua script!
    if item below cursor exists
     pause for 500ms
     clear item
     clear item
    end if

    ...this will automatically clear the item as soon as you release the left button or if an object exists below the cursor then it will wait 500ms before clearing the item which should give the system enough time to execute the dropped item on object action. If you are including the clear item in the object actions instead then you could just include an if object doesn't exist & clear item end if instead in the mouse release actions.

    Hopefully this helps get you on the right track smile


    7283 Posts