Created
December 9, 2012 15:35
-
-
Save phdoerfler/4245638 to your computer and use it in GitHub Desktop.
Three possible way to save JavaFX animations / timelines to XML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Just three variants of how to save animations to XML for animating FXML scenes | |
// Variant 1 | |
<timelines> | |
<timeline id="moveRight"> | |
<at time="0s"> | |
<property ofNode="meepButton" named="layoutX">0</property> | |
</at> | |
<at time="10s"> | |
<property ofNode="meepButton" named="layoutX" tween="linear">200</property> | |
</at> | |
</timeline> | |
</timelines> | |
// Variant 2 | |
<timelines> | |
<timeline id="moveRight"> | |
<key time="0s" node="meepButton" property="layoutX">0</key> | |
<key time="10s" node="meepButton" property="layoutX" tween="linear">200</key> | |
</timeline> | |
</timelines> | |
// Variant 3 | |
<timelines> | |
<moveRight> | |
<layoutX at="0s" node="meepButton">0</layoutX> | |
<layoutX at="10s" node="meepButton" tween="linear">200</layoutX> | |
</moveRight> | |
</timelines> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Variant 1 seems to be the best.