Engine
Raylib based game framework
Loading...
Searching...
No Matches
AnimationSystem.hpp
Go to the documentation of this file.
1#pragma once
2
4#include "Engine/Registry.hpp"
6#include "raylib.h"
7
12
17class AnimationSystem : public System
18{
19public:
20
28 void Update(const float deltaT) override;
29
43 static Component::Animation GridAnimation(const Texture2D texture, const u32 cellWidth, const u32 cellHeight,
44 const u32 startIndex, u32 endIndex, const float duration, const bool loop);
45
54 static void Play(const Entity entity, const Component::Animation& animation);
55
60 static void Stop(const Entity entity);
61
66 static void Resume(const Entity entity);
67
73 static bool IsPlaying(const Entity entity);
74
80 static void SetSpeed(const Entity entity, float speed);
81};
Engine components.
Engine entt::registry wrapper.
Engine lifelong systems and their managing.
Drives Component::Animation and updates Component::Sprite accordingly.
Definition AnimationSystem.hpp:18
static void SetSpeed(const Entity entity, float speed)
Sets the playback speed multiplier.
Definition AnimationSystem.cpp:126
static Component::Animation GridAnimation(const Texture2D texture, const u32 cellWidth, const u32 cellHeight, const u32 startIndex, u32 endIndex, const float duration, const bool loop)
Creates an Animation component from a sprite sheet grid.
Definition AnimationSystem.cpp:49
void Update(const float deltaT) override
Updates all animations.
Definition AnimationSystem.cpp:8
static void Play(const Entity entity, const Component::Animation &animation)
Starts playing an animation on an entity.
Definition AnimationSystem.cpp:85
static bool IsPlaying(const Entity entity)
Checks whether an animation is currently playing.
Definition AnimationSystem.cpp:120
static void Stop(const Entity entity)
Pauses the animation.
Definition AnimationSystem.cpp:100
static void Resume(const Entity entity)
Resumes a paused animation.
Definition AnimationSystem.cpp:110
Base class for all systems.
Definition SystemManager.hpp:27
Frame‑based animation data and playback state.
Definition Components.hpp:52