drag and drop restriction

This forum is currently in read-only mode.
From the Asset Store
Now you can drop everything in your game with sound :)
  • is it possible, when drag and drop object to object can be placed only on some specific places? or if can be places where it cant simply be object droped?

    thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • is it possible, when drag and drop object to object can be placed only on some specific places? or if can be places where it cant simply be object droped?

    thanks

    It is possible, but it will be a little bit tricky.

    Lets take a Sprite object with the dragdrop behavior and Sprite2 as recipient.

    Someplace (global variable, private variable, ...) you need to keep trace of the original Sprite.X and Sprite.Y

    At last you also need a Keyboard & Mouse input object.

    In the event sheet:

    Event Sprite/DragDrop: Sprite.On drop

    Sub Event Mouse: Is mouse over object Sprite2 (inverted) : Position Sprite to original X and Y

    That means that you're droping Sprite anywhere else BUT on Sprite2 and then, putting back Sprite where it was, as it was never moved.

    This should do the trick.

    EDIT: Example: DragDropCancel.cap

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)