Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.Animation Class Reference

Immutable animation resources. More...

Inheritance diagram for Dragengine.Scenery.Animation:

Public Member Functions

Management
String getFilename ()
 Normalized filename the animation has been loaded from. More...
 
int getBoneCount ()
 Count of bones. More...
 
int indexOfBoneNamed (String name)
 Index of named bone or -1 if not found. More...
 
String getBoneName (int index)
 Name of bone at index. More...
 
int getMoveCount ()
 Count of moves. More...
 
int indexOfMoveNamed (String name)
 Index of named move or -1 if not found. More...
 
String getMoveName (int index)
 Name of move at index. More...
 
float getMovePlaytime (String name)
 Playtime in seconds of named move. More...
 
float getMoveFPS (String name)
 Frames per second. More...
 
bool equals (Object other)
 Animation is equal to another object. More...
 
int hashCode ()
 Hash code for use as dictionary keys. More...
 

Constructors

Animation new (String filename)
 Load animation from file. More...
 
void save (String filename)
 Save animation to file. More...
 
static void loadAsynchron (String filename, ResourceListener listener)
 Load animation from file asynchronously. More...
 

Detailed Description

Immutable animation resources.

Animation resources provide static precanned animation data to be used with Animators to produce dynamic animations.

This is a native class. It can not be subclassed.

Member Function Documentation

◆ equals()

bool Dragengine.Scenery.Animation.equals ( Object  other)

Animation is equal to another object.

Implements Object.equals(Object).

Returns
true if other is of type Animation and both point to the same engine animation resource.

◆ getBoneCount()

int Dragengine.Scenery.Animation.getBoneCount ( )

Count of bones.

Version
1.8

◆ getBoneName()

String Dragengine.Scenery.Animation.getBoneName ( int  index)

Name of bone at index.

Version
1.8
Parameters
indexIndex of bone to get name of
Exceptions
EInvalidParamindex is less than 0 or larger than or equal to getBoneCount().

◆ getFilename()

String Dragengine.Scenery.Animation.getFilename ( )

Normalized filename the animation has been loaded from.

◆ getMoveCount()

int Dragengine.Scenery.Animation.getMoveCount ( )

Count of moves.

Version
1.7

◆ getMoveFPS()

float Dragengine.Scenery.Animation.getMoveFPS ( String  name)

Frames per second.

Version
1.6

Used for saving only if animation file format requires sampling.

◆ getMoveName()

String Dragengine.Scenery.Animation.getMoveName ( int  index)

Name of move at index.

Version
1.7
Parameters
indexIndex of move to get name of
Exceptions
EInvalidParamindex is less than 0 or larger than or equal to getMoveCount().

◆ getMovePlaytime()

float Dragengine.Scenery.Animation.getMovePlaytime ( String  name)

Playtime in seconds of named move.

If the move is not found 0 is returned.

◆ hashCode()

int Dragengine.Scenery.Animation.hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

◆ indexOfBoneNamed()

int Dragengine.Scenery.Animation.indexOfBoneNamed ( String  name)

Index of named bone or -1 if not found.

Version
1.8

◆ indexOfMoveNamed()

int Dragengine.Scenery.Animation.indexOfMoveNamed ( String  name)

Index of named move or -1 if not found.

Version
1.7

◆ loadAsynchron()

static void Dragengine.Scenery.Animation.loadAsynchron ( String  filename,
ResourceListener  listener 
)
static

Load animation from file asynchronously.

Registers a request in the game engine to load an animation. Once finished or if the file is already loaded the listener is used to deliver the loaded animation or null if the loading failed.

◆ new()

Animation Dragengine.Scenery.Animation.new ( String  filename)

Load animation from file.

If the animation file has been already loaded it is assigned to this object. If the animation is not loaded yet the engine loads the animation. This call blocks until the animation is fully loaded and ready to be used. For asynchronous loading use loadAsynchron(). Multiple objects can point to the same loaded animation resource. Once no object instance uses an animation file anymore it is released from memory.

◆ save()

void Dragengine.Scenery.Animation.save ( String  filename)

Save animation to file.

Version
1.6

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