Skip to content

Instantly share code, notes, and snippets.

@phdoerfler
Created December 9, 2012 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phdoerfler/4245638 to your computer and use it in GitHub Desktop.
Save phdoerfler/4245638 to your computer and use it in GitHub Desktop.
Three possible way to save JavaFX animations / timelines to XML
// 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>
@guigarage
Copy link

Variant 1 seems to be the best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment