Skip to content

Instantly share code, notes, and snippets.

@ksky
Created June 21, 2012 03:58
Show Gist options
  • Select an option

  • Save ksky/2963743 to your computer and use it in GitHub Desktop.

Select an option

Save ksky/2963743 to your computer and use it in GitHub Desktop.

Revisions

  1. ksky created this gist Jun 21, 2012.
    21 changes: 21 additions & 0 deletions annularEclipse.groovy
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    @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()
    }