Java Reference
In-Depth Information
import jfxbook.shared.PathAnimationControl;
import jfxbook.shared.ProgressSlider;
// The defualt route using SVG path
var routePathStr =
"M21.5,330.0 L186.5,421.0 235.5,335.0 293.5,368.0 "
"407.5,167.0 287.5,103.0 181.5,302.0 68.5,244.0 z";
var buildPathStr:String;
var route = bind SVGPath {
fill: Color.TRANSPARENT
stroke: Color.TRANSPARENT
strokeWidth: 15
content: routePathStr
};
var racear = ImageView {
scaleX: 0.5
scaleY: 0.5
image: Image{ url: "{__DIR__}images/racecar.gif" }
}
var duration = 60s;
def animation = PathTransition {
node: racear
path: bind AnimationPath.createFromPath(route)
orientation: OrientationType.ORTHOGONAL_TO_TANGENT
interpolate: Interpolator.LINEAR
duration: duration
repeatCount: Timeline.INDEFINITE
};
def image = Image {
url: "{__DIR__}images/RockefellerCenter.tif"};
var scene: Scene;
var moveto = true;
Stage {
title: "Path Animation - Midtown Manhattan"
scene: scene = Scene {
width: 700
height: 650
content: VBox {
content: [
Group {
translateX: bind
(scene.width - image.width)/2
continues
Search WWH ::




Custom Search