Skip to main content

Roll

Description:

  Creates a definition for an action that animates the rotation of a Node from one value to another. The roll animation will make sure the node is rotated to the target angle by the minimum rotation angle.

Signature:

Roll: function(
duration: number,
from: number,
to: number,
easing?: Ease.EaseFunc --[[Ease.Linear]]
): ActionDef

Parameters:

ParameterTypeDescription
durationnumberThe duration of the animation in seconds.
fromnumberThe starting roll value of the Node (in degrees).
tonumberThe ending roll value of the Node (in degrees).
easingEaseFunc[optional] The easing function to use for the animation. Defaults to Ease.Linear if not specified.

Returns:

Return TypeDescription
ActionDefAn ActionDef object that can be used to run the animation on a Node.