Closed pixelzoom closed 5 years ago
Hmmm... Looking inside MoveTo
and OpacityTo
, there's not really much there. It might make more sense to replace uses of these with Animation
, and then delete them.
Yes, I think it's best to just replace uses of MoveTo and OpacityTo with Animation, and then delete them.
Sounds good, sorry for the delay
Good, because I'm about half done with this :)
All uses of MoveTo and Opacity have been replaced with Animation, and MoveTo and OpacityTo have been deleted. All usages except one were in my sims.
Assigning to @jonathanolson to review the replacement in capacitor-lab-basics, to decide whether he'd like to use a different variation of the Animation options, and whether to use stepper: 'timer'
. Feel free to close after that review.
I just discovered the object
and attribute
options for animation targets, and I've used them in the above commits. For animating translation and opacity, this is much nicer than how I was previously using setValue
and getValue
options.
Review of capacitor-lab-basics by @jonathanolson is moved to https://github.com/phetsims/capacitor-lab-basics/issues/252, so that this issue can be closed.
There are a bunch of sims that are still preloading Tween via something like this in their package.json:
"preload": [
"../sherpa/lib/Tween-r12.js"
],
I've create sim-specific issues for each such sim.
MoveTo
andOpacityTo
are 2 wrappers around TWEEN. The idea was to insulate sims from the eventual replacement of TWEEN. Since we now have animation support in TWIXT (Animation, Easing, etc.) that replaces TWEEN, the time has come to rewrite MoveTo and OpacityTo.Current usages:
MoveTo
OpacityTo
Since most of this is code that I'm responsible for, it would make sense for me to do this. @ariel-phet OK for me to proceed?