FAST SDK Coding Reference 1.0.3
Loading...
Searching...
No Matches
ImagePlayer Class Reference

A class to play an image sequence of Sprites similar to a GIF. More...

Public Member Functions

void Pause ()
 Pauses playback of the image sequence and keeps the current time.
 
void Play ()
 Starts playing the image sequence.
 
void Stop ()
 Stops playback of the image sequence and resets the current time to 0.
 

Public Attributes

Sprite[] sprites
 Inspector, Runtime
The Sprites that the image sequence is loaded into.
 
Image uiImage
 Runtime
The Image component that will render the current frame of the image sequence.
 

Properties

bool IsPaused [get]
 Runtime
Indicates the image squence is paused if true.
 
bool IsPlaying [get]
 Runtime
Indicates the image squence is playing if true.
 

Private Attributes

int currentFrame
 Runtime
The index of the current frame being played.
 
float currentTime
 Runtime
The elapsed play time of the image sequence in seconds.
 
int frameCount
 Runtime
The total number of frames in the image sequence.
 
float frameRate = 1
 Inspector
The framerate that the image sequence will be played at, measured in frames per second (fps).
 
float frameTime
 Runtime
The duration of one frame of the image sequence in seconds.
 
bool holdLastFrame = true
 Inspector
Set to true if the last frame should be held when the image sequence finishes playing. Otherwise the Image.color will be set to clear/transparent.
 
bool loopPlayback = false
 Inspector
Set to true if the image sequence should play in a loop, otherwise it is played once.
 
bool playOnAwake = true
 Inspector
Set to true if the images sequence should start playing on Awake() or OnEnable().
 
bool skipOnDrop = true
 Inspector
Set to true if frames should be skipped to catch up with the current time.
 
float totalTime
 Runtime
The duration of the image sequence in seconds.
 

Detailed Description

A class to play an image sequence of Sprites similar to a GIF.

The image is rendered to the UI as an Image.

See also
UnityEngine.Sprite
UnityEngine.UI.Image

Member Function Documentation

◆ Pause()

void Pause ( )

Pauses playback of the image sequence and keeps the current time.

◆ Play()

void Play ( )

Starts playing the image sequence.

◆ Stop()

void Stop ( )

Stops playback of the image sequence and resets the current time to 0.

Member Data Documentation

◆ currentFrame

int currentFrame
private

Runtime
The index of the current frame being played.

◆ currentTime

float currentTime
private

Runtime
The elapsed play time of the image sequence in seconds.

◆ frameCount

int frameCount
private

Runtime
The total number of frames in the image sequence.

◆ frameRate

float frameRate = 1
private

Inspector
The framerate that the image sequence will be played at, measured in frames per second (fps).

The minimum framerate is 0.1fps.

◆ frameTime

float frameTime
private

Runtime
The duration of one frame of the image sequence in seconds.

Depends on the FAST.ImagePlayer.frameRate.

◆ holdLastFrame

bool holdLastFrame = true
private

Inspector
Set to true if the last frame should be held when the image sequence finishes playing. Otherwise the Image.color will be set to clear/transparent.

◆ loopPlayback

bool loopPlayback = false
private

Inspector
Set to true if the image sequence should play in a loop, otherwise it is played once.

◆ playOnAwake

bool playOnAwake = true
private

Inspector
Set to true if the images sequence should start playing on Awake() or OnEnable().

◆ skipOnDrop

bool skipOnDrop = true
private

Inspector
Set to true if frames should be skipped to catch up with the current time.

Skipping frames will maintain the duration of the image sequence.

◆ sprites

Sprite [] sprites

Inspector, Runtime
The Sprites that the image sequence is loaded into.

Use FAST.ImagePlayerFromFile to load these Sprites at automatically runtime.

◆ totalTime

float totalTime
private

Runtime
The duration of the image sequence in seconds.

Depends on the FAST.ImagePlayer.frameCount and FAST.ImagePlayer.frameTime.

◆ uiImage

Image uiImage

Runtime
The Image component that will render the current frame of the image sequence.

Retrieved at runtime from FAST.ImagePlayer.Awake and viewable in the Inspector. You can modify the assignment in code, but it is not recommended.

Property Documentation

◆ IsPaused

bool IsPaused
get

Runtime
Indicates the image squence is paused if true.

◆ IsPlaying

bool IsPlaying
get

Runtime
Indicates the image squence is playing if true.


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