Table of Contents

Interface IButtonBuilder

Namespace
BSGameLib.UI.Builder
Assembly
BSGameLib.UI.dll

A button, the Button element of a view file, built in C#.

public interface IButtonBuilder : IControlBuilder<IButtonBuilder>
Inherited Members

Methods

BindText(Action<IControlTextBindingBuilder<IButtonBuilder>>)

Binds the button's text, with the binding set up by configure. Same result as BindText(string).

IButtonBuilder BindText(Action<IControlTextBindingBuilder<IButtonBuilder>> configure)

Parameters

configure Action<IControlTextBindingBuilder<IButtonBuilder>>

Returns

IButtonBuilder

BindText(string)

Binds the button's text to the view model property propertyName.

IButtonBuilder BindText(string propertyName)

Parameters

propertyName string

Returns

IButtonBuilder

WithClickedState(Action<IControlStateBuilder<IButtonBuilder>>)

Configures the button's look while it is pressed with the mouse. Falls back to the normal state when not set.

IButtonBuilder WithClickedState(Action<IControlStateBuilder<IButtonBuilder>> configure)

Parameters

configure Action<IControlStateBuilder<IButtonBuilder>>

Returns

IButtonBuilder

WithCommand(string)

Sets the name of the view model's ICommand property that runs when the button is pressed.

IButtonBuilder WithCommand(string command)

Parameters

command string

Returns

IButtonBuilder

WithFocusedState(Action<IControlStateBuilder<IButtonBuilder>>)

Configures the button's look while it has keyboard focus.

IButtonBuilder WithFocusedState(Action<IControlStateBuilder<IButtonBuilder>> configure)

Parameters

configure Action<IControlStateBuilder<IButtonBuilder>>

Returns

IButtonBuilder

WithFont(string)

Sets the font for the button's text: a BMFont (.fnt) or TrueType (.ttf/.otf) file.

IButtonBuilder WithFont(string fontName)

Parameters

fontName string

Returns

IButtonBuilder

WithFontSize(float)

Sets the point size of the text. Zero keeps the font's own size.

IButtonBuilder WithFontSize(float size)

Parameters

size float

Returns

IButtonBuilder

WithHoverState(Action<IControlStateBuilder<IButtonBuilder>>)

Configures the button's look while the pointer is over it. Falls back to the normal state when not set.

IButtonBuilder WithHoverState(Action<IControlStateBuilder<IButtonBuilder>> configure)

Parameters

configure Action<IControlStateBuilder<IButtonBuilder>>

Returns

IButtonBuilder

WithIsDefault(bool)

Whether this is the view's default button, pressed by Enter. Several may say so; the one in front of the player wins.

IButtonBuilder WithIsDefault(bool isDefault)

Parameters

isDefault bool

Returns

IButtonBuilder

WithLetterSpacing(float)

Sets the extra space between glyphs, in pixels.

IButtonBuilder WithLetterSpacing(float spacing)

Parameters

spacing float

Returns

IButtonBuilder

WithNormalState(Action<IControlStateBuilder<IButtonBuilder>>)

Configures the button's look in its normal state.

IButtonBuilder WithNormalState(Action<IControlStateBuilder<IButtonBuilder>> configure)

Parameters

configure Action<IControlStateBuilder<IButtonBuilder>>

Returns

IButtonBuilder

WithSize(int, int)

Sets the button's size in pixels, as the Size attribute does.

IButtonBuilder WithSize(int width, int height)

Parameters

width int
height int

Returns

IButtonBuilder

WithText(string)

Sets the text on the button. A "{Localize key}" shows that key's text in the current language.

IButtonBuilder WithText(string text)

Parameters

text string

Returns

IButtonBuilder