mirror of
https://github.com/NoelFB/tiny_link.git
synced 2025-07-04 20:25:28 +08:00
room transition + attack anim
This commit is contained in:
@ -0,0 +1,11 @@
|
||||
#include "sprite.h"
|
||||
|
||||
using namespace TL;
|
||||
|
||||
const Sprite::Animation* TL::Sprite::get_animation(const String& name) const
|
||||
{
|
||||
for (auto& it : animations)
|
||||
if (it.name == name)
|
||||
return ⁢
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -17,10 +17,20 @@ namespace TL
|
||||
{
|
||||
String name;
|
||||
Vector<Frame> frames;
|
||||
|
||||
float duration() const
|
||||
{
|
||||
float d = 0;
|
||||
for (auto& it : frames)
|
||||
d += it.duration;
|
||||
return d;
|
||||
}
|
||||
};
|
||||
|
||||
String name;
|
||||
Vec2 origin;
|
||||
Vector<Animation> animations;
|
||||
|
||||
const Animation* get_animation(const String& name) const;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user