Open 3D Engine LyShine Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
UiFlipbookAnimationInterface Class Referenceabstract

#include <UiFlipbookAnimationBus.h>

Inherits AZ::ComponentBus.

Public Types

enum class  LoopType { None , Linear , PingPong }
 Defines the looping behavior when playing back a flipbook animation. More...
 
enum class  FramerateUnits { FPS , SecondsPerFrame }
 Units of speed for framerate. More...
 

Public Member Functions

virtual void Start ()=0
 
virtual void Stop ()=0
 Stops animation playback.
 
virtual bool IsPlaying ()=0
 
virtual AZ::u32 GetStartFrame ()=0
 
virtual void SetStartFrame (AZ::u32 startFrame)=0
 Sets the starting frame of the animation.
 
virtual AZ::u32 GetEndFrame ()=0
 
virtual void SetEndFrame (AZ::u32 endFrame)=0
 Sets the ending frame of the animation.
 
virtual AZ::u32 GetCurrentFrame ()=0
 
virtual void SetCurrentFrame (AZ::u32 currentFrame)=0
 
virtual AZ::u32 GetLoopStartFrame ()=0
 
virtual void SetLoopStartFrame (AZ::u32 loopStartFrame)=0
 Sets the starting frame for looping sequences.
 
virtual LoopType GetLoopType ()=0
 
virtual void SetLoopType (LoopType loopType)=0
 Sets the LoopType of the flipbook animation.
 
virtual float GetFramerate ()=0
 
virtual void SetFramerate (float framerate)=0
 
virtual FramerateUnits GetFramerateUnit ()=0
 Gets the framerate unit.
 
virtual void SetFramerateUnit (FramerateUnits framerateUnit)=0
 Sets the framerate unit.
 
virtual float GetStartDelay ()=0
 Gets the delay (in seconds) before playing the flipbook (applied only once during playback).
 
virtual void SetStartDelay (float startDelay)=0
 Sets the delay (in seconds) before playing the flipbook (applied only once during playback).
 
virtual float GetLoopDelay ()=0
 Gets the delay (in seconds) before playing the loop sequence.
 
virtual void SetLoopDelay (float loopDelay)=0
 Sets the delay (in seconds) before playing the loop sequence.
 
virtual float GetReverseDelay ()=0
 Gets the delay (in seconds) before playing the reverse loop sequence (PingPong loop types only).
 
virtual void SetReverseDelay (float reverseDelay)=0
 Sets the delay (in seconds) before playing the reverse loop sequence (PingPong loop types only).
 
virtual bool GetIsAutoPlay ()=0
 Returns true if the animation will begin playing when the component activates, false otherwise.
 
virtual void SetIsAutoPlay (bool isAutoPlay)=0
 

Detailed Description

Bus that defines the interface for flipbook animations.

A flipbook animation component exists on an entity that has an image component and interacts with the image bus to achieve its functionality (such as by manipulating sprite-sheet indices).

Member Enumeration Documentation

◆ FramerateUnits

Units of speed for framerate.

Enumerator
FPS 

Framerate of animation.

SecondsPerFrame 

Number of seconds to wait before playing next frame.

◆ LoopType

Defines the looping behavior when playing back a flipbook animation.

Enumerator
None 

No looping behavior.

Linear 

When end frame is reached, next frame will be the loop start frame.

PingPong 

When end frame is reached, next frame will be the previous frame, continuing in reverse until the start frame is reached.

Member Function Documentation

◆ GetCurrentFrame()

virtual AZ::u32 UiFlipbookAnimationInterface::GetCurrentFrame ( )
pure virtual
Returns
The current frame of the animation that's being rendered.

◆ GetEndFrame()

virtual AZ::u32 UiFlipbookAnimationInterface::GetEndFrame ( )
pure virtual
Returns
End frame of the animation.

◆ GetFramerate()

virtual float UiFlipbookAnimationInterface::GetFramerate ( )
pure virtual

Gets the speed used to determine when to transition to the next frame.

Framerate is defined relative to unit of time, specified by FramerateUnits.

See GetFramerateUnit, SetFramerateUnit.

◆ GetLoopStartFrame()

virtual AZ::u32 UiFlipbookAnimationInterface::GetLoopStartFrame ( )
pure virtual

This frame is distinct from the start frame and allows a "lead in" seqence of frames to play leading up to the looping animation. The frames that occur prior to the loop start frame will only play once.

Returns
The frame to start the loop from.

◆ GetLoopType()

virtual LoopType UiFlipbookAnimationInterface::GetLoopType ( )
pure virtual
Returns
The LoopType of the flipbook animation.

◆ GetStartFrame()

virtual AZ::u32 UiFlipbookAnimationInterface::GetStartFrame ( )
pure virtual
Returns
The starting frame of the animation.

◆ IsPlaying()

virtual bool UiFlipbookAnimationInterface::IsPlaying ( )
pure virtual
Returns
True if the flipbook animation is currently playing, false otherwise.

◆ SetCurrentFrame()

virtual void UiFlipbookAnimationInterface::SetCurrentFrame ( AZ::u32  currentFrame)
pure virtual

Sets the current frame of the animation to render.

If the animation is currently playing, this will effectively "skip" to the given frame.

◆ SetFramerate()

virtual void UiFlipbookAnimationInterface::SetFramerate ( float  framerate)
pure virtual

Sets the speed used to determine when to transition to the next frame.

Framerate is defined relative to unit of time, specified by FramerateUnits.

See GetFramerateUnit, SetFramerateUnit.

◆ SetIsAutoPlay()

virtual void UiFlipbookAnimationInterface::SetIsAutoPlay ( bool  isAutoPlay)
pure virtual

Sets whether the animation will automatically begin playing.

This flag is ignored after the component has activated.

◆ Start()

virtual void UiFlipbookAnimationInterface::Start ( )
pure virtual

Start the animation sequence, beginning at the start frame.

If a LoopType other than None has been set, the animation won't stop unless explicitly done so (or the image is unloaded/destroyed).


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