JavaFX API supports basic transformations for every Node (and Shape, which extends Node).
Three basic transformations can be used through Node methods:
- setRotate (double angle): Rotates around the center of the Node
- setTranslateX (double pixels), setTranslateY (double pixels): Shifts the Node by a set amount of pixels
- setScaleX (double scale), setScaleY (double scale): Increases (or decreases) the Node by multiplying its horizontal or vertical dimensions by scale
For more complex transformations, the Transform class can be used. It allows us to work precisely with every parameter of the transformation. For example, you can concatenate two transformations into one combined and use two different nodes to save.
Note that through Transform, there are usually more options available. For example, the setRotate() method always uses the center of the shape as a pivot...