Java Reference
In-Depth Information
t3 = Text {
font : Font {size : 24}
textOrigin: TextOrigin.BOTTOM
content: "physics - Bottom"
}
]
},
]
}
}
Text Wrapping
There are several settings to control text wrapping. First, if we insert newline
characters into the content string, the display will present each line separately
(see Figure 5.18).
Text {
font: Font { size: 24 }
x: 10,
y: 30
content: "Hello\nWorld"
}
Figure 5.18
Wrapping with Newline Character
The next option is to set the wrapping width to justify the text between the mar-
gins as defined by the wrappingWidth variable (see Figure 5.19).
Text {
font: Font { size: 24 }
x: 10,
y: 30
wrappingWidth: 150
textAlignment: TextAlignment.JUSTIFY
content:
"Goodbye cruel World now is the time to leave thee"
}
 
Search WWH ::




Custom Search