add toggle function to pause/unpause sb::Animation
This commit is contained in:
parent
5750997d5c
commit
a6a110141d
|
@ -41,6 +41,11 @@ void Animation::unpause()
|
||||||
paused = false;
|
paused = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Animation::toggle(bool state)
|
||||||
|
{
|
||||||
|
state ? unpause() : pause();
|
||||||
|
}
|
||||||
|
|
||||||
void Animation::reset()
|
void Animation::reset()
|
||||||
{
|
{
|
||||||
timer.off();
|
timer.off();
|
||||||
|
|
|
@ -74,6 +74,12 @@ public:
|
||||||
|
|
||||||
void pause();
|
void pause();
|
||||||
void unpause();
|
void unpause();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @param state True to unpause, false to pause
|
||||||
|
*/
|
||||||
|
void toggle(bool state);
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
Loading…
Reference in New Issue