Torque2D Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ImageFrameProviderCore Class Reference

More...

`#include <ImageFrameProviderCore.h>`

Inheritance diagram for ImageFrameProviderCore:

## Public Member Functions
| ImageFrameProviderCore ()
virtual | ~ImageFrameProviderCore ()
void | allocateAssets (AssetPtr< ImageAsset > *pImageAssetPtr, AssetPtr< AnimationAsset > *pAnimationAssetPtr)
void | deallocateAssets (void)
virtual void | copyTo (ImageFrameProviderCore *pImageFrameProviderCore) const
virtual bool | update (const F32 elapsedTime)
| Integration. More...
virtual void | processTick ()
virtual void | interpolateTick (F32 delta)
virtual void | advanceTime (F32 timeDelta)
virtual void | setProcessTicks (bool tick)
bool | updateAnimation (const F32 elapsedTime)
virtual bool | validRender (void) const
virtual void | render (const bool flipX, const bool flipY, const Vector2 &vertexPos0, const Vector2 &vertexPos1, const Vector2 &vertexPos2, const Vector2 &vertexPos3, BatchRender *pBatchRenderer) const
void | renderGui (GuiControl &owner, Point2I offset, const RectI &updateRect) const
bool | setImage (const char *pImageAssetId)
| Static-Image Frame. More...
virtual bool | setImage (const char *pImageAssetId, const U32 frame)
virtual bool | setImage (const char *pImageAssetId, const char *pNamedFrame)
StringTableEntry | getImage (void) const
virtual bool | setImageFrame (const U32 frame)
U32 | getImageFrame (void) const
virtual bool | setNamedImageFrame (const char *frame)
StringTableEntry | getNamedImageFrame (void) const
virtual bool | setAnimation (const char *pAnimationAssetId)
| Animated-Image Frame. More...
StringTableEntry | getAnimation (void) const
void | setAnimationFrame (const U32 frameIndex)
S32 | getAnimationFrame (void) const
void | setAnimationTimeScale (const F32 scale)
F32 | getAnimationTimeScale (void) const
bool | playAnimation (const AssetPtr< AnimationAsset > &animationAsset)
void | pauseAnimation (const bool animationPaused)
void | stopAnimation (void)
void | resetAnimationTime (void)
bool | isAnimationPaused (void) const
bool | isAnimationFinished (void) const
bool | isAnimationValid (void) const
bool | isStaticFrameProvider (void) const
| Frame provision. More...
bool | isUsingNamedImageFrame (void) const
TextureHandle & | getProviderTexture (void) const
const ImageAsset::FrameArea & | getProviderImageFrameArea (void) const
const AnimationAsset * | getCurrentAnimation (void) const
const StringTableEntry | getCurrentAnimationAssetId (void) const
const U32 | getCurrentAnimationFrame (void) const
const char * | getCurrentNamedAnimationFrame (void) const
const F32 | getCurrentAnimationTime (void) const
void | clearAssets (void)
virtual void | resetState (void)
Public Member Functions inherited from Tickable
| Tickable ()
virtual | ~Tickable ()
virtual bool | isProcessingTicks () const

## Protected Member Functions
virtual void | onAnimationEnd (void)
virtual void | onAssetRefreshed (AssetPtrBase *pAssetPtrBase)

## Protected Attributes
bool | mSelfTick
bool | mStaticProvider
bool | mUsingNamedFrame
U32 | mImageFrame
StringTableEntry | mNamedImageFrame
AssetPtr< ImageAsset > * | mpImageAsset
AssetPtr< AnimationAsset > * | mpAnimationAsset
S32 | mLastFrameIndex
S32 | mCurrentFrameIndex
U32 | mMaxFrameIndex
F32 | mCurrentTime
F32 | mPausedTime
F32 | mCurrentModTime
F32 | mAnimationTimeScale
F32 | mTotalIntegrationTime
F32 | mFrameIntegrationTime
bool | mAnimationPaused
bool | mAnimationFinished

## Additional Inherited Members
Static Public Member Functions inherited from Tickable
static bool | advanceTime (U32 timeDelta)
Static Public Attributes inherited from Tickable
static const U32 | smTickShift = 4
| Shift value to control how often Ticks occur. More...
static const U32 | smTickMs = ( 1 << smTickShift )
| Number of milliseconds per tick, 32 in this case. More...
static const F32 | smTickSec = ( F32( Tickable::smTickMs ) / 1000.f )
| Fraction of a second per tick. More...
static const U32 | smTickMask = ( smTickMs - 1 )

## Detailed Description

## Constructor & Destructor Documentation

ImageFrameProviderCore | ( |  | ) |

~ImageFrameProviderCore | ( |  | ) |
| virtual

## Member Function Documentation

virtual void advanceTime | ( | F32 | timeDelta | ) |
| inline virtual

This method is called once every frame regardless of the return value of isProcessingTicks and informs the object of the passage of time

Implements Tickable.

void allocateAssets | ( | AssetPtr< ImageAsset > * | pImageAssetPtr,
|  | AssetPtr< AnimationAsset > * | pAnimationAssetPtr
| ) |  |

void clearAssets | ( | void |  | ) |

void copyTo | ( | ImageFrameProviderCore * | pImageFrameProviderCore | ) | const
| virtual

void deallocateAssets | ( | void |  | ) |
| inline

StringTableEntry getAnimation | ( | void |  | ) | const
| inline

S32 getAnimationFrame | ( | void |  | ) | const
| inline

F32 getAnimationTimeScale | ( | void |  | ) | const
| inline

const AnimationAsset* getCurrentAnimation | ( | void |  | ) | const
| inline

const StringTableEntry getCurrentAnimationAssetId | ( | void |  | ) | const
| inline

const U32 getCurrentAnimationFrame | ( | void |  | ) | const

const F32 getCurrentAnimationTime | ( | void |  | ) | const
| inline

const char * getCurrentNamedAnimationFrame | ( | void |  | ) | const

StringTableEntry getImage | ( | void |  | ) | const
| inline

U32 getImageFrame | ( | void |  | ) | const
| inline

StringTableEntry getNamedImageFrame | ( | void |  | ) | const
| inline

const ImageAsset::FrameArea & getProviderImageFrameArea | ( | void |  | ) | const

TextureHandle& getProviderTexture | ( | void |  | ) | const
| inline

virtual void interpolateTick | ( | F32 | delta | ) |
| inline virtual

This method is called every frame and lets the control interpolate between ticks so you can smooth things as long as isProcessingTicks returns true when it is called on the object

Implements Tickable.

bool isAnimationFinished | ( | void |  | ) | const
| inline

bool isAnimationPaused | ( | void |  | ) | const
| inline

bool isAnimationValid | ( | void |  | ) | const

bool isStaticFrameProvider | ( | void |  | ) | const
| inline

Frame provision.

bool isUsingNamedImageFrame | ( | void |  | ) | const
| inline

virtual void onAnimationEnd | ( | void |  | ) |
| inline protected virtual

Reimplemented in GuiSpriteCtrl, and SpriteBase.

void onAssetRefreshed | ( | AssetPtrBase * | pAssetPtrBase | ) |
| protected virtual

Implements AssetPtrCallback.

Reimplemented in ImageFrameProvider.

void pauseAnimation | ( | const bool | animationPaused | ) |
| inline

bool playAnimation | ( | const AssetPtr< AnimationAsset > & | animationAsset | ) |

void processTick | ( |  | ) |
| virtual

This method is called once every 32ms if isProcessingTicks returns true when called on the object

Implements Tickable.

void render | ( | const bool | flipX,
|  | const bool | flipY,
|  | const Vector2 & | vertexPos0,
|  | const Vector2 & | vertexPos1,
|  | const Vector2 & | vertexPos2,
|  | const Vector2 & | vertexPos3,
|  | BatchRender * | pBatchRenderer
| ) |  | const
| virtual

void renderGui | ( | GuiControl & | owner,
|  | Point2I | offset,
|  | const RectI & | updateRect
| ) |  | const

void resetAnimationTime | ( | void |  | ) |
| inline

void resetState | ( | void |  | ) |
| virtual

Implements IFactoryObjectReset.

Reimplemented in SpriteBatchItem.

bool setAnimation | ( | const char * | pAnimationAssetId | ) |
| virtual

Animated-Image Frame.

Reimplemented in GuiSpriteCtrl.

void setAnimationFrame | ( | const U32 | frameIndex | ) |

void setAnimationTimeScale | ( | const F32 | scale | ) |
| inline

bool setImage | ( | const char * | pImageAssetId | ) |
| inline

Static-Image Frame.

bool setImage | ( | const char * | pImageAssetId,
|  | const U32 | frame
| ) |  |
| virtual

Reimplemented in GuiSpriteCtrl.

bool setImage | ( | const char * | pImageAssetId,
|  | const char * | pNamedFrame
| ) |  |
| virtual

Reimplemented in GuiSpriteCtrl.

bool setImageFrame | ( | const U32 | frame | ) |
| virtual

Reimplemented in GuiSpriteCtrl.

bool setNamedImageFrame | ( | const char * | frame | ) |
| virtual

Reimplemented in GuiSpriteCtrl.

virtual void setProcessTicks | ( | bool | tick | ) |
| inline virtual

Sets this object as either tick processing or not

Parameters

  tick | True if this object should process ticks

Reimplemented from Tickable.

void stopAnimation | ( | void |  | ) |
| inline

bool update | ( | const F32 | elapsedTime | ) |
| virtual

Integration.

bool updateAnimation | ( | const F32 | elapsedTime | ) |

bool validRender | ( | void |  | ) | const
| virtual

Reimplemented in SpriteBase.

## Member Data Documentation

bool mAnimationFinished
| protected

bool mAnimationPaused
| protected

F32 mAnimationTimeScale
| protected

S32 mCurrentFrameIndex
| protected

F32 mCurrentModTime
| protected

F32 mCurrentTime
| protected

F32 mFrameIntegrationTime
| protected

U32 mImageFrame
| protected

S32 mLastFrameIndex
| protected

U32 mMaxFrameIndex
| protected

StringTableEntry mNamedImageFrame
| protected

AssetPtr<AnimationAsset>* mpAnimationAsset
| protected

F32 mPausedTime
| protected

AssetPtr<ImageAsset>* mpImageAsset
| protected

bool mSelfTick
| protected

bool mStaticProvider
| protected

F32 mTotalIntegrationTime
| protected

bool mUsingNamedFrame
| protected

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

- 2d/core/ImageFrameProviderCore.h
- 2d/core/ImageFrameProviderCore.cc