Adding this component to an entity will allow it to be rendered.
More...
#include <Renderable.hpp>
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
Adding this component to an entity will allow it to be rendered.
Definition at line 28 of file Renderable.hpp.
◆ Renderable()
core::component::Renderable::Renderable |
( |
| ) |
|
◆ animLength()
float core::component::Renderable::animLength |
( |
| ) |
const |
Returns the length of the contained animation, or 0.f if no animation.
Definition at line 110 of file Renderable.cpp.
◆ createFromAnimation()
Renderable & core::component::Renderable::createFromAnimation |
( |
bl::engine::Engine & |
engine, |
|
|
bl::ecs::Entity |
entity, |
|
|
bl::rc::Scene * |
scene, |
|
|
const std::string & |
path |
|
) |
| |
|
static |
Creates a renderable component from a single animation.
- Parameters
-
engine | The game engine instance |
scene | The scene to add to |
entity | The entity to construct the component on |
path | The path of the animation |
- Returns
- Renderable The created component
Definition at line 71 of file Renderable.cpp.
◆ createFromFastMoveAnims()
Renderable & core::component::Renderable::createFromFastMoveAnims |
( |
bl::engine::Engine & |
engine, |
|
|
bl::ecs::Entity |
entity, |
|
|
bl::rc::Scene * |
scene, |
|
|
const std::string & |
path |
|
) |
| |
|
static |
Creates a renderable component for movement animations with running.
- Parameters
-
engine | The game engine instance |
entity | The entity to construct the component on |
scene | The scene to add to |
path | The path to the movement animations |
- Returns
- Renderable A usable component
Definition at line 49 of file Renderable.cpp.
◆ createFromMoveAnims()
Renderable & core::component::Renderable::createFromMoveAnims |
( |
bl::engine::Engine & |
engine, |
|
|
bl::ecs::Entity |
entity, |
|
|
bl::rc::Scene * |
scene, |
|
|
const std::string & |
path |
|
) |
| |
|
static |
Creates a renderable component for movement animations.
- Parameters
-
engine | The game engine instance |
entity | The entity to construct the component on |
scene | The scene to add to |
path | The path to the movement animations |
- Returns
- Renderable A usable component
Definition at line 28 of file Renderable.cpp.
◆ createFromSprite()
Renderable & core::component::Renderable::createFromSprite |
( |
bl::engine::Engine & |
engine, |
|
|
bl::ecs::Entity |
entity, |
|
|
bl::rc::Scene * |
scene, |
|
|
const std::string & |
path |
|
) |
| |
|
static |
Creates a renderable component for a static sprite.
- Parameters
-
engine | The game engine instance |
entity | The entity to construct the component on |
scene | The scene to add to |
path | The path to the sprite |
- Returns
- Renderable A usable component
Definition at line 12 of file Renderable.cpp.
◆ getTransform()
bl::com::Transform2D& core::component::Renderable::getTransform |
( |
| ) |
|
|
inline |
◆ notifyMoveState()
void core::component::Renderable::notifyMoveState |
( |
bl::tmap::Direction |
dir, |
|
|
bool |
moving, |
|
|
bool |
running |
|
) |
| |
Call when the entity starts or stops moving or changes direction.
- Parameters
-
dir | The direction the entity is facing |
moving | Whether or not the entity is moving |
running | Whether or not the entity is running |
Definition at line 130 of file Renderable.cpp.
◆ setAngle()
void core::component::Renderable::setAngle |
( |
float |
angle | ) |
|
Sets the angle to render the entity at.
- Parameters
-
Definition at line 108 of file Renderable.cpp.
◆ setHidden()
void core::component::Renderable::setHidden |
( |
bool |
hide | ) |
|
Set whether the entity is hidden or not.
- Parameters
-
hide | True to hide, false to render |
Definition at line 144 of file Renderable.cpp.
◆ triggerAnim()
void core::component::Renderable::triggerAnim |
( |
bool |
loop | ) |
|
Triggers the current animation if any.
- Parameters
-
loop | True to loop, false to play once |
Definition at line 123 of file Renderable.cpp.
◆ system::Render
◆ animSrc
bl::gfx::a2d::AnimationData* core::component::Renderable::animSrc |
◆ runSrc
◆ walkSrc
The documentation for this class was generated from the following files: