Infinite Runner Engine v2.2
Loading...
Searching...
No Matches
MoreMountains.MMInterface.MMSpriteReplaceCycle Class Reference

A class to add to a button so that its sprite cycles through X sprites when pressed. More...

Inheritance diagram for MoreMountains.MMInterface.MMSpriteReplaceCycle:

Public Member Functions

virtual void Swap ()
 Changes the image's sprite to the next sprite in the list.
virtual void SwitchToRandom ()
virtual void SwitchToIndex (int index)
 A public method to set the sprite directly to the one specified in parameters.
virtual void Animate ()

Public Attributes

Sprite[] Sprites
 the list of sprites to cycle through
int StartIndex = 0
 the sprite index to start on
int FrameRate = 10
 when calling Animate (ideally at Update), the framerate to apply (number of frames per second)

Protected Member Functions

virtual void Start ()
 On Start we initialize our cycler.
virtual void Initialization ()
 On init, we grab our image component, and set our first sprite as specified.

Protected Attributes

SpriteRenderer _spriteRenderer
Image _image
MMTouchButton _mmTouchButton
int _currentIndex = 0
bool _imageIsNull = false
bool _spriteRendererIsNull = false
bool _initialized = false
float _timeSinceLastFrame = 0f
float _timePerFrame = 0f

Detailed Description

A class to add to a button so that its sprite cycles through X sprites when pressed.

Member Function Documentation

◆ Animate()

virtual void MoreMountains.MMInterface.MMSpriteReplaceCycle.Animate ( )
virtual

◆ Initialization()

virtual void MoreMountains.MMInterface.MMSpriteReplaceCycle.Initialization ( )
protectedvirtual

On init, we grab our image component, and set our first sprite as specified.

◆ Start()

virtual void MoreMountains.MMInterface.MMSpriteReplaceCycle.Start ( )
protectedvirtual

On Start we initialize our cycler.

◆ Swap()

virtual void MoreMountains.MMInterface.MMSpriteReplaceCycle.Swap ( )
virtual

Changes the image's sprite to the next sprite in the list.

◆ SwitchToIndex()

virtual void MoreMountains.MMInterface.MMSpriteReplaceCycle.SwitchToIndex ( int index)
virtual

A public method to set the sprite directly to the one specified in parameters.

Parameters
indexIndex.

◆ SwitchToRandom()

virtual void MoreMountains.MMInterface.MMSpriteReplaceCycle.SwitchToRandom ( )
virtual

Member Data Documentation

◆ _currentIndex

int MoreMountains.MMInterface.MMSpriteReplaceCycle._currentIndex = 0
protected

◆ _image

Image MoreMountains.MMInterface.MMSpriteReplaceCycle._image
protected

◆ _imageIsNull

bool MoreMountains.MMInterface.MMSpriteReplaceCycle._imageIsNull = false
protected

◆ _initialized

bool MoreMountains.MMInterface.MMSpriteReplaceCycle._initialized = false
protected

◆ _mmTouchButton

MMTouchButton MoreMountains.MMInterface.MMSpriteReplaceCycle._mmTouchButton
protected

◆ _spriteRenderer

SpriteRenderer MoreMountains.MMInterface.MMSpriteReplaceCycle._spriteRenderer
protected

◆ _spriteRendererIsNull

bool MoreMountains.MMInterface.MMSpriteReplaceCycle._spriteRendererIsNull = false
protected

◆ _timePerFrame

float MoreMountains.MMInterface.MMSpriteReplaceCycle._timePerFrame = 0f
protected

◆ _timeSinceLastFrame

float MoreMountains.MMInterface.MMSpriteReplaceCycle._timeSinceLastFrame = 0f
protected

◆ FrameRate

int MoreMountains.MMInterface.MMSpriteReplaceCycle.FrameRate = 10

when calling Animate (ideally at Update), the framerate to apply (number of frames per second)

◆ Sprites

Sprite [] MoreMountains.MMInterface.MMSpriteReplaceCycle.Sprites

the list of sprites to cycle through

◆ StartIndex

int MoreMountains.MMInterface.MMSpriteReplaceCycle.StartIndex = 0

the sprite index to start on


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