Drag and Drop + Set position to another object delay

0 favourites
  • 6 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • My project is to replicate a computer interface. My goal was to make a text box follow a window (sprite) which has the drag and drop behavior.

    I tried a few things, but every time I have the same problem. When I drag and drop my window, the text box follow my window, but with an annoying delay. Here is what I did:

    Every tick || Text box || Set position to Window (image point 6) (top left corner of Window)

    Here is a link for my .capx :

    drive.google.com/open

  • That's because of Pin behavior. You are dragging the Tab sprite and Window is pinned to it. Pin behavior updates Window position after all events are finished. That's why there is a lag.

    To fix this set textbox position to the Tab sprite instead. Or combine the tab and window into one sprite. You can resize its collision polygon (clickable area) to be at the top where the tab is.

  • thank you!!!

  • So textbox set position to tab?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • because that's exactly what I did and it doesn't work. However if I put the tab and the window together it works, but I can't do that in my case, because I made it possible to resize my window in game, so when I do that the bar becomes all stretched out...

  • Yes. Or use "Set position" instead of Pin for the Window.

    Or I would combine the tab and window sprites into one single sprite.

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