Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
esengine::ecs::SpineAnimation Struct Reference

Spine skeletal animation component. More...

#include <SpineAnimation.hpp>

Public Member Functions

 SpineAnimation ()=default
 Default constructor.
 SpineAnimation (const std::string &skelPath, const std::string &atlPath)
 Constructs SpineAnimation with paths.

Public Attributes

std::string skeletonPath
 Path to skeleton data file (.skel or .json).
std::string atlasPath
 Path to atlas file (.atlas).
std::string skin
 Current skin name (empty for default).
std::string animation
 Current animation name.
f32 timeScale {1.0f}
 Animation playback speed multiplier.
bool loop {true}
 Whether to loop the animation.
bool playing {true}
 Whether animation is currently playing.
bool flipX {false}
 Flip skeleton horizontally.
bool flipY {false}
 Flip skeleton vertically.
glm::vec4 color {1.0f, 1.0f, 1.0f, 1.0f}
 Color tint (RGBA, 0-1 range).
i32 layer {0}
 Sorting layer (higher = rendered on top).
f32 skeletonScale {1.0f}
 Skeleton scale factor.
u32 material {0}
 Custom material ID (0 = use default batch shader).
bool enabled {true}
resource::SpineDataHandle skeletonData
 Handle to cached skeleton data (runtime, not serialized).
bool needsReload {true}
 Flag indicating skeleton needs to be reloaded.

Detailed Description

Spine skeletal animation component.

Contains all data needed to render a Spine skeleton including skeleton/atlas paths, animation state, and rendering options.

Entity e = registry.create();
auto& spine = registry.emplace<SpineAnimation>(e);
spine.skeletonPath = "assets/spine/character.skel";
spine.atlasPath = "assets/spine/character.atlas";
spine.animation = "idle";
spine.loop = true;
Entity identifier with packed index + generation.
Definition Types.hpp:135
SpineAnimation()=default
Default constructor.

Definition at line 50 of file SpineAnimation.hpp.

Constructor & Destructor Documentation

◆ SpineAnimation() [1/2]

esengine::ecs::SpineAnimation::SpineAnimation ( )
default

Default constructor.

◆ SpineAnimation() [2/2]

esengine::ecs::SpineAnimation::SpineAnimation ( const std::string & skelPath,
const std::string & atlPath )
inline

Constructs SpineAnimation with paths.

Parameters
skelPathPath to skeleton file
atlPathPath to atlas file

Definition at line 120 of file SpineAnimation.hpp.

References atlasPath, and skeletonPath.

Member Data Documentation

◆ animation

std::string esengine::ecs::SpineAnimation::animation

Current animation name.

Definition at line 65 of file SpineAnimation.hpp.

Referenced by EMSCRIPTEN_BINDINGS().

◆ atlasPath

std::string esengine::ecs::SpineAnimation::atlasPath

Path to atlas file (.atlas).

Definition at line 57 of file SpineAnimation.hpp.

Referenced by SpineAnimation(), and EMSCRIPTEN_BINDINGS().

◆ color

glm::vec4 esengine::ecs::SpineAnimation::color {1.0f, 1.0f, 1.0f, 1.0f}

Color tint (RGBA, 0-1 range).

Definition at line 89 of file SpineAnimation.hpp.

Referenced by EMSCRIPTEN_BINDINGS().

◆ enabled

bool esengine::ecs::SpineAnimation::enabled {true}

Definition at line 104 of file SpineAnimation.hpp.

Referenced by EMSCRIPTEN_BINDINGS().

◆ flipX

bool esengine::ecs::SpineAnimation::flipX {false}

Flip skeleton horizontally.

Definition at line 81 of file SpineAnimation.hpp.

Referenced by EMSCRIPTEN_BINDINGS().

◆ flipY

bool esengine::ecs::SpineAnimation::flipY {false}

Flip skeleton vertically.

Definition at line 85 of file SpineAnimation.hpp.

Referenced by EMSCRIPTEN_BINDINGS().

◆ layer

i32 esengine::ecs::SpineAnimation::layer {0}

Sorting layer (higher = rendered on top).

Definition at line 93 of file SpineAnimation.hpp.

Referenced by EMSCRIPTEN_BINDINGS().

◆ loop

bool esengine::ecs::SpineAnimation::loop {true}

Whether to loop the animation.

Definition at line 73 of file SpineAnimation.hpp.

Referenced by EMSCRIPTEN_BINDINGS().

◆ material

u32 esengine::ecs::SpineAnimation::material {0}

Custom material ID (0 = use default batch shader).

Definition at line 101 of file SpineAnimation.hpp.

Referenced by EMSCRIPTEN_BINDINGS().

◆ needsReload

bool esengine::ecs::SpineAnimation::needsReload {true}

Flag indicating skeleton needs to be reloaded.

Definition at line 110 of file SpineAnimation.hpp.

◆ playing

bool esengine::ecs::SpineAnimation::playing {true}

Whether animation is currently playing.

Definition at line 77 of file SpineAnimation.hpp.

Referenced by EMSCRIPTEN_BINDINGS().

◆ skeletonData

resource::SpineDataHandle esengine::ecs::SpineAnimation::skeletonData

Handle to cached skeleton data (runtime, not serialized).

Definition at line 107 of file SpineAnimation.hpp.

◆ skeletonPath

std::string esengine::ecs::SpineAnimation::skeletonPath

Path to skeleton data file (.skel or .json).

Definition at line 53 of file SpineAnimation.hpp.

Referenced by SpineAnimation(), and EMSCRIPTEN_BINDINGS().

◆ skeletonScale

f32 esengine::ecs::SpineAnimation::skeletonScale {1.0f}

Skeleton scale factor.

Definition at line 97 of file SpineAnimation.hpp.

Referenced by EMSCRIPTEN_BINDINGS().

◆ skin

std::string esengine::ecs::SpineAnimation::skin

Current skin name (empty for default).

Definition at line 61 of file SpineAnimation.hpp.

Referenced by EMSCRIPTEN_BINDINGS().

◆ timeScale

f32 esengine::ecs::SpineAnimation::timeScale {1.0f}

Animation playback speed multiplier.

Definition at line 69 of file SpineAnimation.hpp.

Referenced by EMSCRIPTEN_BINDINGS().


The documentation for this struct was generated from the following file: