MovementAnimation

class MovementAnimation<T : ComponentView>(    componentView: T,     fromX: Number = componentView.posX,     toX: Number = componentView.posX,     fromY: Number = componentView.posY,     toY: Number = componentView.posY,     duration: Int = DEFAULT_ANIMATION_SPEED) : ComponentAnimation<T>

A movement Animation.

Moves given ComponentView relative to parents anchor point.

Parameters

T

Generic ComponentView.

componentView

ComponentView to animate

fromX

Initial X position. Default: Current ComponentView.posX.

toX

Resulting X position. Default: Current ComponentView.posX.

fromY

Initial Y position. Default: Current ComponentView.posY.

toY

Resulting Y position. Default: Current ComponentView.posY.

duration

Duration in milliseconds. Default: DEFAULT_ANIMATION_SPEED.

Constructors

Link copied to clipboard
fun <T : ComponentView> MovementAnimation(    componentView: T,     byX: Number = 0.0,     byY: Number = 0.0,     duration: Int = 1000)

A movement animation. Moves given ComponentView relative to parents anchor point.

Link copied to clipboard
fun <T : ComponentView> MovementAnimation(    componentView: T,     fromX: Number = componentView.posX,     toX: Number = componentView.posX,     fromY: Number = componentView.posY,     toY: Number = componentView.posY,     duration: Int = DEFAULT_ANIMATION_SPEED)

Creates a MovementAnimation for the given ComponentView.

Types

Link copied to clipboard
object Companion

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
val fromX: Double

Initial X position.

Link copied to clipboard
val fromY: Double

Initial Y position.

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 toX: Double

Resulting X position.

Link copied to clipboard
val toY: Double

Resulting Y position.