Skip to content
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

Set/get method of current frame and additional methods of play(from & to)/loop(from) specific frame #1244

Closed
wants to merge 0 commits into from

Conversation

chengenzhao
Copy link
Contributor

@chengenzhao chengenzhao commented Mar 5, 2023

fix #1243
fix #1198
several new methods

1. set/getCurrentFrame
2. animate() //play from current frame and stops on the last frame
3. playFrom(int startFrame) //same as setCurrentFrame(startFrame); animate();
4. loopFrom(int startFrame) //starts animation from startFrame and then keep looping
5. playTo(int pauseFrame) //start playing animation and pause on the specific frame
6. play(int startFrame, int pauseFrame) //star playing from startFrame and pause on the specific frame
8. playAnimationChannel(channel, startFrame) //same as setCurrentFrame(startFrame); continueAnimationChannel();
9. playAnimationChannel(channel, startFrame, pauseFrame) //play specific anime channel from start frame to pause frame
10. loopAnimationChannel(channel, startFrame) //loop animations but starts from specific frame
11. isPlaying and isPaused methods of AnimatedTexture
12. unit tests

@codecov-commenter
Copy link

codecov-commenter commented Mar 5, 2023

Codecov Report

Merging #1244 (88b7bc2) into dev (6ba4715) will increase coverage by 0.00%.
The diff coverage is 56.00%.

❗ Current head 88b7bc2 differs from pull request most recent head 729746f. Consider uploading reports for the commit 729746f to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff            @@
##                dev    #1244   +/-   ##
=========================================
  Coverage     58.69%   58.69%           
- Complexity     2934     2962   +28     
=========================================
  Files           303      303           
  Lines         15014    15063   +49     
  Branches       1534     1556   +22     
=========================================
+ Hits           8812     8841   +29     
+ Misses         5698     5696    -2     
- Partials        504      526   +22     
Impacted Files Coverage Δ
.../kotlin/com/almasb/fxgl/texture/AnimatedTexture.kt 62.03% <44.44%> (-8.80%) ⬇️
...main/kotlin/com/almasb/fxgl/animation/Animation.kt 97.01% <85.71%> (+0.71%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@chengenzhao chengenzhao changed the title Set/get method of current frame and additional methods of play/loop from specific frame Set/get method of current frame and additional methods of play(from & to)/loop(from) specific frame Mar 6, 2023
@AlmasB
Copy link
Owner

AlmasB commented Mar 13, 2023

Thanks for this, I should have time within the next several days to take a look at it. It's doing a bit more than just exposing current frame, so I might merge these incrementally.

@AlmasB
Copy link
Owner

AlmasB commented Mar 14, 2023

@chengenzhao it would be good to add you to the list of Coordinators in README, if you are interested?

@chengenzhao
Copy link
Contributor Author

chengenzhao commented Mar 14, 2023

@chengenzhao it would be good to add you to the list of Coordinators in README, if you are interested?

Sure, that would be nice for me, thank you

@chengenzhao
Copy link
Contributor Author

chengenzhao commented Mar 15, 2023

Thanks for this, I should have time within the next several days to take a look at it. It's doing a bit more than just exposing current frame, so I might merge these incrementally.

https://docs.oracle.com/javase/9/docs/api/javafx/animation/Animation.html#playFrom-java.lang.String-

I just read the Timeline class of JavaFX
Is it a good idea if we keep the same name as Timeline?
like jumpTo(), play() and playFromStart()
and that means we need to change the play method implementation
the original play method will be renamed to playFromStart()
the new play method means play from that point(jumpTo & play)
but because the jumpTo() method is brand new
so legacy code won't be affected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants