Skip to content

AnimationAsset Guide

MelvMay-GG edited this page Feb 21, 2013 · 5 revisions

Introduction

All assets are known engine types that allow instances to be created at runtime. The "AnimationAsset", like all assets, is derived from a base type of "AssetBase". That means it includes all the fields from that type as well as adding its own fields specific to itself.

The AnimationAsset provides a way to refer to any ImageAsset that contains frames and select those frames for playing in a specified order to produce an animation of images.

For an AnimationAsset to be valid, it must contain at least a single frame selected from a valid ImageAsset.

TorqueScript Bindings

Exposed Fields

The AnimationAsset type exposes the following fields in addition to those it inherits. Shown are the equivalent methods available that perform the same action in setting and getting the respective field:

  • Image
    • setImage(imageAssetId)
    • getImage()
  • AnimationFrames
    • setAnimationFrames(string)
    • getAnimationFrames()
  • AnimationTime
    • setAnimationTime(float)
    • getAnimationTime();
  • AnimationCycle
    • setAnimationCycle(bool)
    • getAnimationCycle()
  • RandomStart
    • setRandomStart(bool)
    • getRandomStart()

The following is a complete description of each of these fields.

Image (string)

This is a mandatory field and refers to the image asset that should be used as the source for frames. This field should be an asset-Id that refers to an ImageAsset. If it does not refer to a valid asset (or the module the asset is defined in has not been loaded) or it is not an ImageAsset or the asset is not valid then the animation is not be valid.

Clone this wiki locally