Java Reference
In-Depth Information
Text {
translateX: 10, translateY: 30
content: "This is my Text"
font: Font { size: 36 }
fill: Color.TRANSPARENT
stroke: Color.BLACK
}
Figure 5.14
Outline Text
Now let's rotate it 45 degrees (see Figure 5.15).
Text {
translateX: 10, translateY: 30
content: "This is my Text"
font: Font { size: 36 }
fill: Color.TRANSPARENT
stroke: Color.BLACK
rotate: 45
}
Figure 5.15
Rotated 45 Degrees
What happened? When we use the rotate variable, the rotation is anchored on the
center point. This is also true if we had used the scaleX and scaleY variables;
the scaling would have been from the center point, which is not always desired.
If we want to rotate at the origin point, 0,0, we need to use a Rotate transform,
javafx.scene.transform.Rotate (see Figure 5.16) .
Text {
translateX: 10, translateY: 30
content: "This is my Text"
Search WWH ::




Custom Search