TranslateTransition
Inherits from: Transition > Timeline
Overview
This
Transition creates a move/translate animation that spans its #duration. This is done by updating the
translateX,
translateY and
translateZ variables of the
node at regular interval.
It starts from the (
fromX,
fromY,
fromZ) value if provided else uses the
node's (
translateX,
translateY,
translateZ) value.
It stops at the (
toX,
toY,
toZ) value if provided else it will use start value plus (
byX,
byY,
byZ) value.
The (
toX,
toY,
toZ) value takes precedence if both (
toX,
toY,
toZ) and (
byX,
byY,
byZ) values are specified.
Code Segment Example:
import javafx.scene.shape.*;
import javafx.animation.transition.*;
...
var node = Rectangle {
x: 100 y: 40
height: 100 width: 100
arcHeight: 50 arcWidth: 50
fill: Color.VIOLET
}
var transTransition = TranslateTransition {
duration: 2s node: node
byX: 200 repeatCount:4 autoReverse: true
}
transTransition.play();
...
Profile: common
Variable Summary
| name | type | Default Value | description |
|---|---|---|---|
| duration | Duration | 400ms |
The length of this
|
| fromX | Number | Transition.UNDEFINED |
Specifies the start X coordinate value of this
|
| fromY | Number | Transition.UNDEFINED |
Specifies the start Y coordinate value of this
|
| fromZ | Number | Transition.UNDEFINED |
Specifies the start Z coordinate value of this
|
| toX | Number | Transition.UNDEFINED |
Specifies the stop X coordinate value of this
|
| toY | Number | Transition.UNDEFINED |
Specifies the stop Y coordinate value of this
|
| toZ | Number | Transition.UNDEFINED |
Specifies the stop Z coordinate value of this
|
| byX | Number | Transition.UNDEFINED |
Specifies the incremented stop X coordinate value, from the start, of this
|
| byY | Number | Transition.UNDEFINED |
Specifies the incremented stop Y coordinate value, from the start, of this
|
| byZ | Number | Transition.UNDEFINED |
Specifies the incremented stop Z coordinate value, from the start, of this
|
Inherited Variables
Transition
| name | type | Default Value | description |
|---|---|---|---|
| node | Node | null |
The target node of this
|
| interpolator | Interpolator | EASEBOTH |
Controls the timing for acceleration and deceleration at each transition cycle. This may only be changed prior to starting the transition or after the transition has ended. If changed during a transition then the change will not take effect until the next transition. Default interpolator is set to Interpolator#EASEBOTH. |
Timeline
| name | type | Default Value | description |
|---|---|---|---|
| rate | Number | 1.0 |
Defines the direction/speed at which the
The absolute value of
Rate
Inverting the rate of a running
|
| time | Duration | 0s |
Defines the
If
If user wants to bind the variable and update it simultaneously, bidirectional
|
| interpolate | Boolean | true |
Enable/disable interpolation. |
| repeatCount | Number | 1.0 |
Defines the number of cycles in this animation. The
|
| autoReverse | Boolean | false |
Defines whether this animation reverses direction on alternating cycles. If
|
| keyFrames | KeyFrame |
Defines the sequence of
| |
| framerate | Number |
The maximum framerate at which this animation will run, in frames per second. This can be used, for example, to keep particularly complex Timelines from over-consuming system resources. By default, a Timeline's framerate is not explicitly limited, meaning the Timeline will run at an optimal framerate for the underlying platform. |
