yomotsu / gl-slideshow

A JavaScript library for advanced 2D slideshow with WebGL, that provides variety of beautiful effects
83 stars 12 forks source link

Programmatically set progress? #14

Open amr3k opened 11 months ago

amr3k commented 11 months ago

Hi, thanks a lot for this great library, I was wondering if it's possible to set the transition progress programmatically.. in case of a touch swipe, or hover before/after effect like this one:

https://github.com/yomotsu/gl-slideshow/assets/12211826/16dccd68-7b52-488c-b319-a76cd3dd9259

amr3k commented 11 months ago

Update: I was able to do that with:

slideshow._progress = 0.23;
slideshow._hasUpdated = true;

Of course typescript compiler was complaining so I had to @ts-ignore it 😃

However, it'd be better to expose a function that allows to set the progress value e.g function setProgress(value:number) {...}