object:cancel()

Type Function
Return value none
Revision Release 2024.3703
Keywords animation, tween, interpolation, cancel
See also animation.cancel()
Tween
animation.*

Overview

Cancels a Tween object.

Syntax

object:cancel()

Example

local object1 = display.newRect( 50, 50, 100, 100 )

-- Move the object
local newTween = animation.to( object1, { x=150, y=400 }, { time=5000 } )

-- Sometime later, cancel the tween
newTween:cancel()