persona-3-dual
A DS demake of Persona 3
Loading...
Searching...
No Matches
UIDelayAnimation.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
11
16{
17 public:
18 explicit UIDelayAnimation(int durationMs)
19 {
20 duration = MathManager::getInstance().div(ae::q20_12_t{durationMs}, ae::q20_12_t{1000});
21 }
22
23 void reset() override
24 {
26 }
27
28 protected:
29 bool onUpdate(ae::q20_12_t dt) override
30 {
31 elapsed += dt;
32 return elapsed >= duration;
33 }
34
35 private:
36 ae::q20_12_t duration{0};
37};
Base class for one UI animation step (property, delay, callback, sequence).
ae::q20_12_t elapsed
virtual void reset()
Resets runtime state so the animation can play again (used by Loop).
UIAnimation(const UIAnimation &)=delete
void reset() override
Resets runtime state so the animation can play again (used by Loop).
UIDelayAnimation(int durationMs)
bool onUpdate(ae::q20_12_t dt) override
Per-frame update.