Nox Engine
 
Loading...
Searching...
No Matches
Animator::Animation Struct Reference

Represents a single, self-contained animation sequence. More...

#include <Animator.h>

Collaboration diagram for Animator::Animation:
Collaboration graph

Public Member Functions

 Animation (const char *id)
 Constructs an Animation with a given ID.
 
 Animation (const char *id, SDL_Point frameSize, const char *texPath, int speed=100, bool isLooping=true, bool isReversible=false)
 Constructs and initializes a complete Animation object.
 

Public Attributes

const charid
 Unique identifier for the animation.
 
int frames
 The number of frames in the sprite sheet.
 
SDL_Texturetexture
 The texture containing the animation frames.
 
int speed = 100
 The delay in milliseconds between frames.
 
bool loop
 Whether the animation should loop upon completion.
 
bool reversible = false
 If true, the animation plays forwards then backwards.
 

Detailed Description

Represents a single, self-contained animation sequence.

Constructor & Destructor Documentation

◆ Animation() [1/2]

Animator::Animation::Animation ( const char id)

Constructs an Animation with a given ID.

Parameters
idThe unique identifier for this animation.

◆ Animation() [2/2]

Animator::Animation::Animation ( const char id,
SDL_Point  frameSize,
const char texPath,
int  speed = 100,
bool  isLooping = true,
bool  isReversible = false 
)

Constructs and initializes a complete Animation object.

Parameters
idThe unique identifier for this animation.
frameSizeThe dimensions (width, height) of a single frame.
texPathThe file path to the sprite sheet texture.
speedThe delay in milliseconds between frames.
isLoopingWhether the animation should loop.
isReversibleWhether the animation should play in reverse after finishing.
Here is the call graph for this function:

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