Skip to main content
Version: 4.16

WildcardTextButtonStyle

A wildcard text button style. An wildcard text button style. This class is supposed to be used with one of the ButtonTrigger classes to create a functional button. This class will show a text with a wildcard in one of two colors depending on the state of the button (pressed or released).

The WildcardTextButtonStyle does not set the size of the enclosing container (normally AbstractButtonContainer). The size must be set manually.

To get a background behind the text, use WildcardTextButtonStyle together with e.g. ImageButtonStyle:

WildcardTextButtonStyle<ImageButtonStyle<ClickButtonTrigger> > myButton;

The position of the text can be adjusted with setTextXY (default is centered).

Template Parameters:

See: AbstractButtonContainer

Inherits from: T

Public Functions#

voidsetWildcardText(TypedText t)
Sets wildcard text.
voidsetWildcardTextBuffer(const Unicode::UnicodeChar * buffer)
Sets wildcard text buffer.
voidsetWildcardTextColors(colortype newColorReleased, colortype newColorPressed)
Sets wild card text colors.
voidsetWildcardTextPosition(int16_t x, int16_t y, int16_t width, int16_t height)
Sets text position and dimensions.
voidsetWildcardTextRotation(TextRotation rotation)
Sets wildcard text rotation.
voidsetWildcardTextX(int16_t x)
Sets wildcard text x coordinate.
voidsetWildcardTextXY(int16_t x, int16_t y)
Sets wildcard text position.
voidsetWildcardTextY(int16_t y)
Sets wildcard text y coordinate.
WildcardTextButtonStyle()

Protected Functions#

virtual voidhandleAlphaUpdated()
Handles what should happen when the alpha is updated.
virtual voidhandlePressedUpdated()
Handles what should happen when the pressed state is updated.

Protected Attributes#

colortypecolorPressed
The color pressed.
colortypecolorReleased
The color released.
TextAreaWithOneWildcardwildcardText
The wildcard text.

Public Functions Documentation#

setWildcardText#

Sets wildcard text.

Parameters:
tA TypedText to process.

setWildcardTextBuffer#

Sets wildcard text buffer.

Parameters:
bufferIf non-null, the buffer.

setWildcardTextColors#

void setWildcardTextColors(colortypenewColorReleased ,
colortypenewColorPressed
)

Sets wild card text colors.

Parameters:
newColorReleasedThe new color released.
newColorPressedThe new color pressed.

setWildcardTextPosition#

void setWildcardTextPosition(int16_tx ,
int16_ty ,
int16_twidth ,
int16_theight
)

Sets text position and dimensions.

Parameters:
xThe x coordinate.
yThe y coordinate.
widthThe width of the text.
heightThe height of the text.

setWildcardTextRotation#

Sets wildcard text rotation.

Parameters:
rotationThe rotation.

setWildcardTextX#

void setWildcardTextX(int16_tx)

Sets wildcard text x coordinate.

Parameters:
xThe x coordinate.

setWildcardTextXY#

void setWildcardTextXY(int16_tx ,
int16_ty
)

Sets wildcard text position.

Parameters:
xThe x coordinate.
yThe y coordinate.

setWildcardTextY#

void setWildcardTextY(int16_ty)

Sets wildcard text y coordinate.

Parameters:
yThe y coordinate.

WildcardTextButtonStyle#

Protected Functions Documentation#

handleAlphaUpdated#

virtual void handleAlphaUpdated()

Handles what should happen when the alpha is updated.

handlePressedUpdated#

virtual void handlePressedUpdated()

Handles what should happen when the pressed state is updated.

Protected Attributes Documentation#

colorPressed#

colortype colorPressed

The color pressed.

colorReleased#

colortype colorReleased

The color released.

wildcardText#

The wildcard text.