MovementAnimation

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.

Parameters

componentView

ComponentView to animate

byX

Relative X movement.

byY

Relative Y movement.

duration

Animation duration in milliseconds. Default: 1 second


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.

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.