1 #ifndef CORE_COMPONENTS_RENDERABLE_HPP
2 #define CORE_COMPONENTS_RENDERABLE_HPP
4 #include <BLIB/ECS/Registry.hpp>
5 #include <BLIB/Graphics/Animation2D.hpp>
6 #include <BLIB/Graphics/Slideshow.hpp>
7 #include <BLIB/Graphics/Sprite.hpp>
8 #include <BLIB/Resources.hpp>
9 #include <BLIB/Tilemap/Position.hpp>
45 bl::rc::Scene* scene,
const std::string& path);
57 bl::rc::Scene* scene,
const std::string& path);
69 bl::rc::Scene* scene,
const std::string& path);
81 bl::rc::Scene* scene,
const std::string& path);
102 void notifyMoveState(bl::tmap::Direction dir,
bool moving,
bool running);
124 enum SourceType { Walk, Run, SingleAnim, Sprite } srcType;
130 bl::rc::rcom::DrawableBase* drawable;
131 bl::com::Transform2D* transform;
132 bl::com::Animation2DPlayer* player;
133 bl::ecs::Entity shadow;
Core classes and functionality for both the editor and game.
Adding this component to an entity will allow it to be rendered.
res::WalkAnimations * walkSrc
bl::gfx::a2d::AnimationData * animSrc
static Renderable & createFromAnimation(bl::engine::Engine &engine, bl::ecs::Entity entity, bl::rc::Scene *scene, const std::string &path)
Creates a renderable component from a single animation.
void setHidden(bool hide)
Set whether the entity is hidden or not.
void setAngle(float angle)
Sets the angle to render the entity at.
bl::com::Transform2D & getTransform()
Returns the render transform.
float animLength() const
Returns the length of the contained animation, or 0.f if no animation.
static Renderable & createFromFastMoveAnims(bl::engine::Engine &engine, bl::ecs::Entity entity, bl::rc::Scene *scene, const std::string &path)
Creates a renderable component for movement animations with running.
static Renderable & createFromSprite(bl::engine::Engine &engine, bl::ecs::Entity entity, bl::rc::Scene *scene, const std::string &path)
Creates a renderable component for a static sprite.
res::RunWalkAnimations * runSrc
static Renderable & createFromMoveAnims(bl::engine::Engine &engine, bl::ecs::Entity entity, bl::rc::Scene *scene, const std::string &path)
Creates a renderable component for movement animations.
void triggerAnim(bool loop)
Triggers the current animation if any.
Renderable()
Does nothing.
void notifyMoveState(bl::tmap::Direction dir, bool moving, bool running)
Call when the entity starts or stops moving or changes direction.
Extension of animation data that loads and combines the animations for each movement direction into a...
Extension of animation data that loads and combines the animations for each movement direction into a...
Basic system that synchronizes animation states based on movement state events.