Interface ILabelBuilder
A label, the Label element of a view file, built in C#.
public interface ILabelBuilder : IControlBuilder<ILabelBuilder>
- Inherited Members
Methods
AlignCenter()
Aligns the text to the center of the label.
ILabelBuilder AlignCenter()
Returns
AlignLeft()
Aligns the text to the left of the label.
ILabelBuilder AlignLeft()
Returns
AlignRight()
Aligns the text to the right of the label.
ILabelBuilder AlignRight()
Returns
BindText(Action<IControlTextBindingBuilder<ILabelBuilder>>)
Binds the text, with the binding set up by configure. Same result as BindText(string).
ILabelBuilder BindText(Action<IControlTextBindingBuilder<ILabelBuilder>> configure)
Parameters
configureAction<IControlTextBindingBuilder<ILabelBuilder>>
Returns
BindText(string)
Binds the text to the view model property propertyName.
ILabelBuilder BindText(string propertyName)
Parameters
propertyNamestring
Returns
NoWrap()
Keeps the text on one line, even when it is wider than the label.
ILabelBuilder NoWrap()
Returns
WithBorderColor(string)
Sets the color of a border drawn around the label's bounds.
ILabelBuilder WithBorderColor(string colorHex)
Parameters
colorHexstring
Returns
WithBorderThickness(int)
Sets the border's width in pixels. Has no effect without a border color.
ILabelBuilder WithBorderThickness(int thickness)
Parameters
thicknessint
Returns
WithColor(string)
Sets the color of the text.
ILabelBuilder WithColor(string colorHex)
Parameters
colorHexstring
Returns
WithFillColor(string)
Sets a flat fill drawn behind the text.
ILabelBuilder WithFillColor(string colorHex)
Parameters
colorHexstring
Returns
WithFillGradient(string)
Sets a gradient fill drawn behind the text, naming a Gradient resource.
ILabelBuilder WithFillGradient(string gradientId)
Parameters
gradientIdstring
Returns
WithFont(string)
Sets the font for the text: a BMFont (.fnt) or TrueType (.ttf/.otf) file.
ILabelBuilder WithFont(string fontName)
Parameters
fontNamestring
Returns
WithFontSize(float)
Sets the point size of the text. Zero keeps the font's own size.
ILabelBuilder WithFontSize(float size)
Parameters
sizefloat
Returns
WithLetterSpacing(float)
Sets the extra space between glyphs, in pixels.
ILabelBuilder WithLetterSpacing(float spacing)
Parameters
spacingfloat
Returns
WithSize(int, int)
Sets the label's size in pixels.
ILabelBuilder WithSize(int width, int height)
Parameters
Returns
WithText(string)
Sets the text. A "{Localize key}" shows that key's text in the current language.
ILabelBuilder WithText(string text)
Parameters
textstring
Returns
Wrap()
Wraps the text onto further lines when it is wider than the label.
ILabelBuilder Wrap()