|
Post by nugget on May 2, 2023 13:29:26 GMT
Hello !
I would like to know if it's possible to "interrupt" the JumpToDataIndex function ?.
Can't really show the code but here's my usecase : After x seconds, I start an autoscroll from the first item to the last using the JumpToDataIndex. While it's autoscrolling, I want the user to be able to click to do a manual scroll (so, stopping the jump). When he's done; the autoscrolling restarts.
Is there a way to do this without modifying the Jump/Tween functions you're using in the plugin ?
Thanks in advance !
|
|
|
Post by echo17 on May 3, 2023 9:33:42 GMT
Yep, this is a pretty simple update. I've published v2.26.0 that will handle this. I've added a new member called tweenPaused that is set to false by default. If you set this to true, either through the inspector or code, the tweening will not process. When set back to true, the tweening will resume.
|
|
|
Post by nugget on May 3, 2023 14:24:26 GMT
Very nice, I'll give it a try asap. Thanks !
|
|
|
Post by nugget on May 15, 2023 21:05:20 GMT
Hello, so I've tried the pauseTween option (from code) but after setting it to false to resume the autoscrolling it goes back to the item it has stopped in when the user started a manual drag. Is there an option to resume from the position we've dragged to ?
|
|
|
Post by echo17 on May 16, 2023 14:42:26 GMT
I've submitted an update (v2.37.0) that adds a method ToggleTweenPaused that will switch the pause state back and forth. When unpausing, it will resume tweening from the current scroll position. ToggleTweenPaused has an optional parameter that allows you to set a new tween time. If the parameter is negative it will just use the remaining tween time from before the pause.
|
|
|
Post by nugget on May 16, 2023 18:20:32 GMT
Works like a charm, thanks !
|
|