Struct Engine::AnimationClip¶
ClassList > Engine > AnimationClip
Encapsulates static configuration data for a single animation state. More...
#include <Animation.hpp>
Public Attributes¶
| Type | Name |
|---|---|
| std::vector< std::string > | assetPaths |
| std::vector< FrameData > | frameData |
| float | frameDuration = 0.1f |
| float | frameHeight = 0.0f |
| float | frameWidth = 0.0f |
| bool | loop = true |
| std::string | name = "Idle" |
| std::size_t | totalFrames = 0 |
Public Functions¶
| Type | Name |
|---|---|
| AnimationClip () = default Default constructor. |
|
| AnimationClip (std::string clipName, std::vector< std::string > paths, float duration=0.1f, bool isLooping=true) Constructs a clip from multiple individual image files. |
|
| AnimationClip (std::string clipName, const std::string & sheetPath, float width, float height, std::size_t total=0, float duration=0.1f, bool isLooping=true) Constructs a clip for uniform grid-based spritesheets. |
|
| AnimationClip (std::string clipName, const std::string & sheetPath, std::vector< FrameData > frames, float duration=0.1f, bool isLooping=true) Constructs a clip using explicit custom FrameData definitions. |
Detailed Description¶
Stores frame sources, slicing geometry, timing, and looping settings. Supports three workflows:
* Multiple discrete file paths (assetPaths).
* Uniform spritesheet slicing (frameWidth x frameHeight).
* Custom variable-sized frames (frameData).
Public Attributes Documentation¶
variable assetPaths¶
Paths to image assets or a single spritesheet.
variable frameData¶
Explicit frame rectangles for variable spritesheets.
variable frameDuration¶
Playback time per frame in seconds.
variable frameHeight¶
Height of each frame for uniform slicing (0 = full sprite).
variable frameWidth¶
Width of each frame for uniform slicing (0 = full sprite).
variable loop¶
Indicates whether playback repeats after finishing.
variable name¶
Unique identifier name of the clip.
variable totalFrames¶
Total frame count override (0 = auto-calculate).
Public Functions Documentation¶
function AnimationClip [¼]¶
Default constructor.
function AnimationClip [2/4]¶
Constructs a clip from multiple individual image files.
Engine::AnimationClip::AnimationClip (
std::string clipName,
std::vector< std::string > paths,
float duration=0.1f,
bool isLooping=true
)
Parameters:
clipNameIdentifier for the animation clip.pathsList of asset paths representing sequential frames.durationDisplay time per frame in seconds.isLoopingWhether the animation loops continuously.
function AnimationClip [¾]¶
Constructs a clip for uniform grid-based spritesheets.
Engine::AnimationClip::AnimationClip (
std::string clipName,
const std::string & sheetPath,
float width,
float height,
std::size_t total=0,
float duration=0.1f,
bool isLooping=true
)
Parameters:
clipNameIdentifier for the animation clip.sheetPathPath to the spritesheet texture asset.widthWidth of a single frame cell in pixels.heightHeight of a single frame cell in pixels.totalTotal number of frames in the grid (0 = auto-calculate).durationDisplay time per frame in seconds.isLoopingWhether the animation loops continuously.
function AnimationClip [4/4]¶
Constructs a clip using explicit custom FrameData definitions.
Engine::AnimationClip::AnimationClip (
std::string clipName,
const std::string & sheetPath,
std::vector< FrameData > frames,
float duration=0.1f,
bool isLooping=true
)
Parameters:
clipNameIdentifier for the animation clip.sheetPathPath to the texture atlas asset.framesArray of explicit frame rectangles and pivots.durationDisplay time per frame in seconds.isLoopingWhether the animation loops continuously.
The documentation for this class was generated from the following file /home/runner/work/r-type/r-type/Engine/include/Components/Animation.hpp