AnimationKit.MoveTask

Inherits from AnimationKit.Task. Only available to Desktop projects.

This class is used for manipulating the size and position of windows and controls, probably the most used class in the framework.

Constructors

Target As RectControl

Creates the task with the specified control set to the Item property. The Left, Top, Width, and Height properties will be set to the control's current position.

Target As Window

Creates the task with the specified window set to the Item property. The Left, Top, Width, and Height properties will be set to window's current position.

Properties

AnimateHeight As Boolean = False

When true, the target's Height property will be animated.

AnimateLeft As Boolean = False

When true, the target's Left property will be animated.

AnimateTop As Boolean = False

When true, the target's Top property will be animated.

AnimateWidth As Boolean = False

When true, the target's Width property will be animated.

Curve As AnimationKit.Curve = AnimationKit.Curve.CreateLinear()

The timing curve to use for this animation.

DurationInSeconds As Double = 1.0

Number of seconds the animation will require to complete.

Height As Double = Target.Height

The final height of the target. Changing this value automatically sets AnimateHeight to True.

Left As Double = Target.Left

The final left position of the target. Changing this value automatically sets AnimateLeft to True.

Top As Double = Target.Top

The final top position of the target. Changing this value automatically sets AnimateTop to True.

Width As Double = Target.Width

The final width of the target. Changing this value automatically sets AnimateWidth to True.

Methods

Sub EnableValues (ParamArray Keys() As UInt64)

Pass one or more of the Key constants to enable property animations in bulk.

Sub DisableValues (ParamArray Keys() As UInt64)

Pass one or more of the Key constants to disable property animations in bulk.

Function OriginalRect () As Xojo.Core.Rect

Returns the starting rect of the target. May return Nil if the animation has not started.

Sub SetDestination (Source As Xojo.Core.Rect)

Sets the destination of the target using the provided rect. Also accepts a REALbasic.Rect in desktop projects. Only values which differ from the control's current position will be animated. Automatically sets the value of all four Animate properties accordingly.

Constants

Const KeyHeight = 8
Const KeyLeft = 1
Const KeyTop = 2
Const KeyWidth = 4

iOS Projects

This task has all the functionality necessary to support iOSControl animations, but the iOSControl cannot be moved. So the class is currently disabled on iOS despite being designed to work for iOS projects.

The reason iOSControls cannot be moved is because of the auto layout system. Moving a control requires manipulating the restraints around it, which is not immediately practical. Support for iOSControl animations may come in the future.

Web Projects

This task does not support WebControl due to the high latency of web communications. In its current form, the latency prohibits the animation from working in any reasonable manner. In the future, it may be possible to translate the task properties into a CSS animation so the browser can run the animation entirely client side.

See Also

AnimationKit.Curve