I've been toying around with spritesheet-based animations in Twine, and I found out about this
javascript library called Greensock, and I'm wondering how to use it in Twine. I heard about Userlib.js from
this post, but I'm not really sure how to make one of those files. How do I make a userlib.js file so that I can use this with Sugarcube?
Comments
[list type=decimal]
Download the GreenSock Animation Platform (GSAP).
Copy the
TweenMax.min.js
file (greensock-js.zip:greensock-js/src/minified/TweenMax.min.js
) to SugarCube's target directory and rename it touserlib.js
(i.e.{TWINE_INSTALL}/targets/sugarcube/userlib.js
).Profit!
Slightly more involved way:
[list type=decimal]
Download the GreenSock Animation Platform (GSAP).
Create a new plain-text file in SugarCube's target directory named
userlib.js
(i.e.{TWINE_INSTALL}/targets/sugarcube/userlib.js
).Decide which GSAP modules and plug-ins you wish to use and copy-paste the contents of the corresponding files (suggest using the minified versions) into the
userlib.js
file you created. It's possible that, at least, some modules will require a specific ordering, so use whatever order is suggested by the GSAP docs.Profit!