Created
June 21, 2012 03:58
-
-
Save ksky/2963743 to your computer and use it in GitHub Desktop.
GroovyFX timeline sample
This file contains hidden or 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
@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