TwoWildcardTextButtonStyle
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 TwoWildcardTextButtonStyle 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 TwoWildcardTextButtonStyle together with e.g. ImageButtonStyle:
TwoWildcardTextButtonStyle<ImageButtonStyle<ClickButtonTrigger> > myButton;
The position of the text can be adjusted with setTwoWildcardTextXY (default is centered).
Template Parameters:
- T Generic type parameter. Typically a AbstractButtonContainer subclass.
Inherits from: T
Public Functions
void | setTwoWildcardText(TypedText t) |
Sets wildcard text. | |
void | setTwoWildcardTextColors(colortype newColorReleased, colortype newColorPressed) |
Sets wild card text colors. | |
void | setTwoWildcardTextPosition(int16_t x, int16_t y, int16_t width, int16_t height) |
Sets text position and dimensions. | |
void | setTwoWildcardTextRotation(TextRotation rotation) |
Sets wildcard text rotation. | |
void | setTwoWildcardTextX(int16_t x) |
Sets wildcard text x coordinate. | |
void | setTwoWildcardTextXY(int16_t x, int16_t y) |
Sets wildcard text position. | |
void | setTwoWildcardTextY(int16_t y) |
Sets wildcard text y coordinate. | |
void | setWildcardTextBuffer1(const Unicode::UnicodeChar * value) |
Sets the first wildcard in the text. | |
void | setWildcardTextBuffer2(const Unicode::UnicodeChar * value) |
Sets the second wildcard in the text. | |
TwoWildcardTextButtonStyle() | |
Protected Functions
virtual void | handleAlphaUpdated() |
Handles what should happen when the alpha is updated. | |
virtual void | handlePressedUpdated() |
Handles what should happen when the pressed state is updated. | |
Protected Attributes
colortype | colorPressed |
The color pressed. | |
colortype | colorReleased |
The color released. | |
TextAreaWithTwoWildcards | twoWildcardText |
The wildcard text. | |
Public Functions Documentation
setTwoWildcardText
void setTwoWildcardText | ( | TypedText | t | ) | |
setTwoWildcardTextColors
void setTwoWildcardTextColors | ( | colortype | newColorReleased , | ||
colortype | newColorPressed | ||||
) |
Sets wild card text colors.
newColorReleased | The new color released. |
newColorPressed | The new color pressed. |
setTwoWildcardTextPosition
void setTwoWildcardTextPosition | ( | int16_t | x , | ||
int16_t | y , | ||||
int16_t | width , | ||||
int16_t | height | ||||
) |
Sets text position and dimensions.
x | The x coordinate. |
y | The y coordinate. |
width | The width of the text. |
height | The height of the text. |
setTwoWildcardTextRotation
void setTwoWildcardTextRotation | ( | TextRotation | rotation | ) | |
Sets wildcard text rotation.
rotation | The rotation. |
setTwoWildcardTextX
void setTwoWildcardTextX | ( | int16_t | x | ) | |
Sets wildcard text x coordinate.
x | The x coordinate. |
setTwoWildcardTextXY
void setTwoWildcardTextXY | ( | int16_t | x , | ||
int16_t | y | ||||
) |
Sets wildcard text position.
x | The x coordinate. |
y | The y coordinate. |
setTwoWildcardTextY
void setTwoWildcardTextY | ( | int16_t | y | ) | |
Sets wildcard text y coordinate.
y | The y coordinate. |
setWildcardTextBuffer1
void setWildcardTextBuffer1 | ( | const Unicode::UnicodeChar * | value | ) | |
Sets the first wildcard in the text.
Must be a null-terminated UnicodeChar array.
value | A pointer to the UnicodeChar to set the wildcard to. |
setWildcardTextBuffer2
void setWildcardTextBuffer2 | ( | const Unicode::UnicodeChar * | value | ) | |
Sets the second wildcard in the text.
Must be a null-terminated UnicodeChar array.
value | A pointer to the UnicodeChar to set the wildcard to. |
TwoWildcardTextButtonStyle
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.
twoWildcardText
TextAreaWithTwoWildcards twoWildcardText
The wildcard text.