メイン・コンテンツまでスキップ

AnimatedImageButtonStyle

touchgfx/containers/buttons/AnimatedImageButtonStyle.hpp

An animated image button style. An animated image button style. This class is supposed to be used with one of the ButtonTrigger classes to create a functional button. This class will show the first or last image of an animated image depending on the state of the button (pressed or released). When the state changes the button will show the sequence of images in forward or reversed order.

The AnimatedImageButtonStyle will set the size of the enclosing container (normally AbstractButtonContainer) to the size of the first Bitmap. This can be overridden by calling setWidth/setHeight after setting the bitmaps.

The position of the bitmap can be adjusted with setBitmapXY (default is upper left corner).

Template Parameters:

See: AbstractButtonContainer

Inherits from: T

Public Functions

AnimatedImageButtonStyle()
voidsetBitmaps(const Bitmap & bitmapStart, const Bitmap & bitmapEnd)
Sets the bitmaps.
voidsetBitmapXY(uint16_t x, uint16_t y)
Sets bitmap x and y.
voidsetUpdateTicksInterval(uint8_t updateInterval)
Sets update ticks interval.

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

AnimatedImagebuttonAnimatedImage
The button animated image.

Public Functions Documentation

AnimatedImageButtonStyle

setBitmaps

void setBitmaps(const Bitmap &bitmapStart ,
const Bitmap &bitmapEnd
)

Sets the bitmaps.

Parameters:
bitmapStartThe bitmap start.
bitmapEndThe bitmap end.

setBitmapXY

void setBitmapXY(uint16_tx ,
uint16_ty
)

Sets bitmap x and y.

Parameters:
xAn uint16_t to process.
yAn uint16_t to process.

setUpdateTicksInterval

void setUpdateTicksInterval(uint8_tupdateInterval)

Sets update ticks interval.

Parameters:
updateIntervalThe update interval.

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

buttonAnimatedImage

AnimatedImage buttonAnimatedImage

The button animated image.