How do I Drag image if click on Specific Area of Image

0 favourites
  • 5 posts
From the Asset Store
High quality sound effect pack, in the following categories: Simple, negative, pozitive
  • I have an image and instances and given drag & drop behavior

    I want that If i click near the border of image then do not Drag But if click far from border inside then drag

    I hope you understand what i want to explain

    Image Sample attached

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • luckyrawatlucky create invisible draggable sprite and everytick set Image position to that sprite.

  • Or pin your image to invisible draggable sprite.

    Or simple change the collision polygon on your sprite - make it smaller.

  • this works but still getting some problems

    But First Let me explain the actual thing

    I have canvas plugin inserted 200x200

    then did 48 copied and scattered randomly in layout

    I added sprite with small size which i used for click

    I set them all in front of all scattered canvas

    Now i am able to drag

    but this formula doesn't work when some canvas are overlapped

    My Event system is

    When Mouse Left click on Canvas

    == Cursor is over sprite

    == Sprite is overlapping with Canvas >> Canvas DragDrop Enabled

    ++ Else >> Disabled

    Every tick >> Set Sprite Position to Canvas

  • Why so complicated? Remove Drag&Drop from Canvas, enable Drag&Drop on the Sprite.

    Pin each pair Canvas+Sprite together:

    On Start of Layout:

    For each Sprite

    ....Canvas overlapping Sprite: Canvas pin to Sprite

    That's it, you should now be able to drag & drop canvases.

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