-
-
Notifications
You must be signed in to change notification settings - Fork 557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New methods play & playReverse of Animation class #1287
base: dev
Are you sure you want to change the base?
Conversation
compared to start & startReverse, play methods won't reset time when functions are called. Similar to the same method in the Animation class of JavaFX Also refactor playAnimationChannel method of AnimatedTexture class to adopt this change.
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #1287 +/- ##
============================================
- Coverage 59.69% 59.66% -0.03%
Complexity 2961 2961
============================================
Files 308 308
Lines 15262 15271 +9
Branches 1561 1563 +2
============================================
+ Hits 9111 9112 +1
- Misses 5628 5636 +8
Partials 523 523 ☔ View full report in Codecov by Sentry. |
/** | ||
* Plays Animation from current position in the direction indicated by rate. | ||
*/ | ||
fun play(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just wondering when this would be called. The current position in the animation can be controlled with pause/resume
. isAnimating
is always true when the animation is active. So the only way this is actually run is when the animation is fully stopped, meaning it matches the implementation of start
. Does that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's say there is an AnimationChannel of wall clock starts from 0 to 12 clock
in the app, we want the clock animation starts from current time
so it would be nice to have
setTimeTo(currentTime)
play()
and later we may have
play(currentTime)//starts from currentTime
//or to more specific
playFrom(currentTime)
to replace the pure start() method
and later we may need playTo(specificPauseTime) method
and may have fluent method like
animation.setTimeTo(currentTime)
.playTo(specificTime) //when it comes to specific time, it will pause
.playReverseTo(anotherTimeEarlier) //like resume to another time
.play(); //continue playing the rest animation
//or
animation.play(from: currentTime, to: specificTime) //play from current time to specific time, when it comes to specific time, animation will pause
.playReverseTo(anotherTimeEarlier) //like resume to another time
.play(); //continue playing the rest animation
Hi:
The animation class may need a play from current position method similar to the same name method of JavaFX Animation class.
And this will simplify the further development of AnimatedTextures.
#1244