Happy new year everyone!
I have an array of pixi sprites and would like to move it along the x axis in an inifinte loop. I will be using GSAP for the animation part.
I came across this very nice gsap helper function : Seamlessly loop elements along the x-axis
Unfortunetaly this function does not work with pixi objects.
Is there an easy way to adapt this function so it can properly handle sprites? If not, what would be the most basic way to create an infinite x loop on an array
Hi amine,
That helper function is using the ModifiersPlugin under the hood, but the concept will still be the same for PixiJS or any other JavaScript object.
You can literally drop in your Pixi objects to this pen and it should work fine.
See the Pen QEdpLe by GreenSock (@GreenSock) on CodePen
The only adjustment you is that you don't need to worry about units because PixiJS doesn't have any.
gsap.to(arra