Tileset animations.
This commit is contained in:
@ -11,7 +11,8 @@ using namespace Dawn;
|
||||
PokerPlayerDisplay::PokerPlayerDisplay(UICanvas *canvas) :
|
||||
UIEmpty(canvas),
|
||||
labelName(canvas),
|
||||
labelChips(canvas)
|
||||
labelChips(canvas),
|
||||
animChips(&animChipsValue)
|
||||
{
|
||||
this->font = getGame()->assetManager.get<TrueTypeAsset>("truetype_ark");
|
||||
|
||||
@ -36,6 +37,9 @@ PokerPlayerDisplay::PokerPlayerDisplay(UICanvas *canvas) :
|
||||
0.0f
|
||||
);
|
||||
|
||||
// Anim
|
||||
this->animChips.easing = &easeOutQuart;
|
||||
|
||||
// Events
|
||||
getScene()->eventSceneUnpausedUpdate.addListener(this, &PokerPlayerDisplay::onSceneUpdate);
|
||||
}
|
||||
@ -68,8 +72,8 @@ void PokerPlayerDisplay::onPlayerChipsChanged() {
|
||||
std::cout << "Chips" << player->chips << std::endl;
|
||||
|
||||
this->animChips.clear();
|
||||
this->animChips.addKeyframe(&this->animChipsValue, 0.0f, this->animChipsValue);
|
||||
this->animChips.addKeyframe(&this->animChipsValue, 1.0f, this->player->chips);
|
||||
this->animChips.addKeyframe(0.0f, this->animChipsValue);
|
||||
this->animChips.addKeyframe(1.0f, this->player->chips);
|
||||
this->animChips.restart();
|
||||
}
|
||||
|
||||
|
@ -9,12 +9,12 @@
|
||||
#include "poker/PokerPlayer.hpp"
|
||||
#include "asset/AssetManager.hpp"
|
||||
#include "asset/assets/TrueTypeAsset.hpp"
|
||||
#include "display/animation/Animation.hpp"
|
||||
#include "display/animation/SimpleAnimation.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class PokerPlayerDisplay : public UIEmpty {
|
||||
private:
|
||||
Animation<int32_t> animChips;
|
||||
SimpleAnimation<int32_t> animChips;
|
||||
int32_t animChipsValue;
|
||||
|
||||
protected:
|
||||
|
Reference in New Issue
Block a user