|
Krotos Modules 3
|
Helper class to create DrawableButtons with opacity hover states using a single Drawable resource. Lower overhead than the traditional method as it only instantiates as many drawables as needed. More...
#include <DrawableButtonHelpers.h>
Public Member Functions | |
| OpacityDrawableButton (std::unique_ptr< Drawable > drawable, const String &name, DrawableButton::ButtonStyle style, float opacityNormal, float opacityHover=0.0f, float opacityDown=0.0f, Colour targetColourToChangeAlpha=Colours::white) | |
| Creates a DrawableButton with opacity hover states specified by the targetColourToChangeAlpha. This may not work for all drawable SVGs since it relies on changing a single colour. it's best suited for simple graphics that use a single colour. Lower overhead than creating 3 separate drawables for each state and only instantiates as many drawables as needed. | |
Helper class to create DrawableButtons with opacity hover states using a single Drawable resource. Lower overhead than the traditional method as it only instantiates as many drawables as needed.
| krotos::OpacityDrawableButton::OpacityDrawableButton | ( | std::unique_ptr< Drawable > | drawable, |
| const String & | name, | ||
| DrawableButton::ButtonStyle | style, | ||
| float | opacityNormal, | ||
| float | opacityHover = 0.0f, | ||
| float | opacityDown = 0.0f, | ||
| Colour | targetColourToChangeAlpha = Colours::white ) |
Creates a DrawableButton with opacity hover states specified by the targetColourToChangeAlpha. This may not work for all drawable SVGs since it relies on changing a single colour. it's best suited for simple graphics that use a single colour. Lower overhead than creating 3 separate drawables for each state and only instantiates as many drawables as needed.
| drawable | The drawable to use for the button. |
| name | The name of the button. |
| style | The draw style. |
| opacityNormal | Default opacity to draw at. |
| opacityHover | Opacity to draw when the mouse is hovering over |
| opacityDown | Opacity to draw at when the mouse is down |
| targetColourToChangeAlpha | The target colour in the SVG to apply the alpha to. |