RandomizeAnimation

class RandomizeAnimation<T : GameComponentView>(    gameComponentView: T,     val visuals: List<Visual>,     val toVisual: Visual,     duration: Int = DEFAULT_ANIMATION_DURATION,     speed: Int = DEFAULT_ANIMATION_SPEED) : SteppedComponentAnimation<T>

A randomization Animation that shuffles between different visuals.

Shuffles through visuals in the given visuals for given duration and shows toVisual in the end. Use the speed parameter to define how many steps the animation should have.

For example:

An animation with duration = 1s and speed = 50 will change the visual 50 times within the duration of one second.

Parameters

gameComponentView

GameComponentView to animate.

duration

Duration in milliseconds. Default: DEFAULT_ANIMATION_DURATION.

speed

Count of steps. Default: DEFAULT_ANIMATION_SPEED.

Constructors

Link copied to clipboard
fun <T : GameComponentView> RandomizeAnimation(    gameComponentView: T,     visuals: List<Visual>,     toVisual: Visual,     duration: Int = DEFAULT_ANIMATION_DURATION,     speed: Int = DEFAULT_ANIMATION_SPEED)

Creates a RandomizeAnimation for the given GameComponentView.

Properties

Link copied to clipboard
val componentView: T

ComponentView to animate.

Link copied to clipboard
val duration: Int

Duration in milliseconds.

Link copied to clipboard
var isRunning: Boolean

Boolean indicating whether the Animation is currently running.

Link copied to clipboard
var onFinished: (AnimationFinishedEvent) -> Unit?

Gets invoked when Animation has finished.

Link copied to clipboard
val speed: Int

Speed in steps.

Link copied to clipboard
val toVisual: Visual

Resulting Visual after shuffle.

Link copied to clipboard
val visuals: List<Visual>

List of Visuals to shuffle through.