Jump to content
Search Community

samsy

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by samsy

  1. Using an Iframe is definitely not an option. It add perfs issues, and a ton of complexity. Adding tweens to a global timeline on the fly, removing them, pausing them, timescaling them etc.. leads to bugs. That is definitely an advanced use-case. But if I'd like my game to stop running while displaying some UI MENU in top of it, I usually use the FPS ticker as RAF, and set the FPS ticker to 0 ( suspend all tween, suspend all delayed call etc.. ). That is pretty handy, that is just a one-line instruction to pause the entire game. But because the UI is also using GSAP to animate things, the whole game is suspended then. I'm not working on that UI part though, but sharing a same gsap instance in this case really leads to problem as multiple developers are working on different parts of the project. We just cannot set independant global gsap settings / framerate etc.. I guess we'll just switch to another animation library ! Many thanks
  2. Ho sorry ! If there is a solution for that, that would be amazing !
  3. Not really, Creating those two instances of gsap into singletons classes ( one for UI let say and one for your Game ), helps you to import the gsap instance you want straight into the file that needs it import gsap from 'uigsap' or import gsap from 'gamegsap' Are definitely less of a work than adding a data property to each tween. For that example, the actual naming would stay the same, we are still using 'gsap.whatever' but the instance required is a different one and would not require to write specific data for each tween.
  4. I think those are great, but are not what I'd be looking for there. - getTweensOf is a bit local when you get + 100 files containing 100 tweens. Bit hard to select them into all thoses classes. - A timeline wont work, cause tweens are created / killed / removed / added on the fly - Data property might work, but it needs to be added and implemented in every tweens. In a 100 files project that is not really convenient. Unless writing a wrapper around gsap to aggregate, but it causes too much writing where I think it could be much simpler. Having an instance of gsap ( without relying on a timeline ) could really help to set different global options to each of them getTweensOf
  5. Not really. I'd be looking for : let gsapinstance0 = ???? let gsapinstance1 = ???? // gsapInstance0 != gsapInstance1 == true gsapInstance0.to / from / etc.. gsapInstance1.to / from / etc.. gsapInstance0.ticker.fps(0) Trying to get multiple instances of gsap where, for example, changing fps ticker does not affect the other instance. I understand the use of timeline etc.. for this, but those are global properties.
  6. I'm re-opening this thread I'm afraid ;) Is there a simple way to get actual separated global instances of gsap ? Same use-case.. Having a game I need to pause, and the rest of the website to still run. Using different instances would make the code really more simpler in order to pause all the tweens in an instance.
×
×
  • Create New...