Controlling onDrag position after releasing

I haven't tried a test using the script you posted, but when I run the "Spelling.app" I do not see the tiles with the letters in them snap back.

Okay Greg, thank you :smile:

@Stephen is there really no way to reset the gesture API, or change the current value of it ? Timelines seem to have the same problem. The down side leaving it as it is, is that you can have many wrong letters all over the place and thus making it difficult for a child to spell.

Running a timeline that moves the element will update its position in Hype. This means if you play a timeline and then drag the element it will correctly drag from its current position. So you can have a drag end play a Relative Timeline which will move the element from its current position to the final position. Then the next drag should work correctly.

Let me know if you are seeing something different.

1 Like

I did try that, as I said above, it does not seem to update the gesture move position. The element it self is updated, but the second you drag it, it goes to its last position on drag.

Using relative timelines did not, from my understanding, change the position stored in gesture move. The timeline played, but nothing happened, as it was moving, as far as it was concerned, from top 0px, left 0px to top 0px left 0px.

It is not the element, Hype seems to know the element is at 0px top and left, but gesture move, it does not. And I did a number of tests to using logical statements in gesture move, start and end to demonstrate this.

It is very odd, as would needing to have 26 timelines, one for each letter.

Could you send me your Hype Document so I can take a look?

I agree it isn’t ideal, we definitely would like to add a real Javascript API which would allow you to set values, making this situation a lot easier to deal with. For your situation it may be easier to write javascript to handle the drag instead of using the Hype drag handler.

Hi Stephen, thanks for taking a look. I PM’ed you the file.

If I have to use my own javascript to create a drag event, it would mean I would have to take it out of Hype. I do not want load to consist of unused code, and this would be the case.

I tend to build in Hype when, pretty much, all of its ability is used. If I do not use much of it, I tend to build it from scratch.

Is this on your roadmap for a future update, and if so, can you hint at time frames?

It is definitely on our road map, but unfortunately I can’t promise a date yet. Thanks for letting us know this feature is important, it helps us plan our future updates.