/* * Star.fx * * Created on Dec 21, 2008, 8:40:20 PM */ package homesky; import javafx.animation.Interpolator; import javafx.animation.KeyFrame; import javafx.animation.Timeline; import javafx.scene.CustomNode; import javafx.scene.Group; import javafx.scene.Node; import javafx.scene.paint.Color; import javafx.scene.shape.Polygon; import javafx.scene.shape.Circle; /** * @author Vaibhav Choudhary */ public class Star extends CustomNode { public var x: Number; public var y: Number; public var color:Color; public var r: Number; var t = Timeline { repeatCount: Timeline.INDEFINITE keyFrames: [ KeyFrame { time: 3s canSkip: true values: [ r => 360.0 tween Interpolator.EASEBOTH ] } ] } init{ t.play()} public override function create(): Node { return Group { content: [ Circle { translateX: bind x translateY: bind y centerX: 0, centerY: 0 radius: 1 fill: Color.WHITE } ] }; } }