NWengine 0.9
Loading...
Searching...
No Matches
Animation Class Reference

The Animation class represents a sequence of frames with durations. More...

#include <Animation.h>

Public Member Functions

void AddFrame (Texture *texture, double duration)
 Adds a frame to the animation.
 
void DeleteFrame (uint16 index)
 Deletes a frame from the animation.
 
void SetLinearDuration (double totalDuration)
 Sets the duration of each frame to make the animation linear.
 

Public Attributes

std::vector< Texture * > frames
 
std::vector< doubledurations
 
bool repeat = false
 

Detailed Description

The Animation class represents a sequence of frames with durations.

Member Function Documentation

◆ AddFrame()

void Animation::AddFrame ( Texture * texture,
double duration )

Adds a frame to the animation.

Parameters
textureThe texture of the frame.
durationThe duration of the frame in seconds.

◆ DeleteFrame()

void Animation::DeleteFrame ( uint16 index)

Deletes a frame from the animation.

Parameters
indexThe index of the frame to delete.

◆ SetLinearDuration()

void Animation::SetLinearDuration ( double totalDuration)

Sets the duration of each frame to make the animation linear.

Parameters
totalDurationThe total duration of the animation in seconds.

Member Data Documentation

◆ durations

std::vector<double> Animation::durations

The durations of each frame in seconds.

◆ frames

std::vector<Texture*> Animation::frames

The frames of the animation.

◆ repeat

bool Animation::repeat = false

Flag indicating if the animation should repeat.


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