Text
What it does
- This displays text. It is that simple.
Builder Parameters
text- An
ITextComponentobject that represents the text string to be displayed. It can be constructed using aStringobject with theStringTextComponentclass.
- An
color(Optional)- Color of the text.
- Default: White
overflowBehaviour(Optional)- Defines how the text is displayed when it exceeds the available space. If not provided, it defaults to
OverflowBehaviour.OVERFLOW. - Default: Overflow
- Defines how the text is displayed when it exceeds the available space. If not provided, it defaults to
Size Behaviour
- Minimum
Example
public class TestText implements UIComponent {
@Override
public UIComponent build(Layout layout) {
return new Center(
new Text.Builder("Wow hello a lot of textttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt")
.withOverflowBehaviour(Text.OverflowBehaviour.ELLIPSIS)
);
}
}
What it looks like
