Skip to content

Instantly share code, notes, and snippets.

@ksky
Created June 21, 2012 03:58
Show Gist options
  • Save ksky/2963743 to your computer and use it in GitHub Desktop.
Save ksky/2963743 to your computer and use it in GitHub Desktop.
GroovyFX timeline sample
@Grab('org.codehaus.groovyfx:groovyfx:0.2')
import static groovyx.javafx.GroovyFX.start
start {
stage(visible: true) {
scene(width: 400, height: 400, fill: black) {
circle(centerX: 200, centerY: 200, radius: 110, fill: yellow) {
effect dropShadow(color: white, radius: 50)
}
moon = circle(centerX: 400, centerY: 0, radius: 100, fill: black)
}
}
eclipse = timeline {
at (60.s) {
change (moon, 'centerX') { to 0 }
change (moon, 'centerY') { to 400 }
}
}
eclipse.play()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment