GTween.nextTween
From GiderosMobile
Available since: Gideros 2010-2011
Class: GTween
Description
Simple sequenced tweens.
GTween.nextTween = GTween.new(target,duration,values,props)
Example
require "easing"
application:setBackgroundColor(0x626262)
local x, y = 8*32, 8*32
local pixel = Pixel.new(math.random(0xffffff), 1, 32, 32)
pixel:setAnchorPoint(0.5, 0.5)
pixel:setPosition(x, y)
stage:addChild(pixel)
--function GTween:init(target, duration, values, props)
local tween = GTween.new(
pixel, 1,
{ x=x, y=y-4*32, alpha=1.7, scaleY=2.5, },
{ delay=4, ease=easing.outBack, repeatCount=1, dispatchEvents=true, }
)
tween.nextTween = GTween.new(
pixel, 0.7,
{ y=y, alpha=1, scaleY=1, },
{ ease=easing.outBounce, repeatCount=1, }
)
tween:addEventListener("change", function()
print("change!", tween:getPosition())
end)
tween:addEventListener("complete", function()
-- tween:toEnd() -- toBeginning(), toEnd()
-- tween:setPosition(0.75)
print("tweened!")
end)
- GTween
- GTween.new
- GTween.nextTween
- GTween.stopAll
- GTween:deleteValue
- GTween:getDelay
- GTween:getInitValue
- GTween:getPosition
- GTween:getValue
- GTween:getValues
- GTween:init2
- GTween:isPaused
- GTween:resetValues
- GTween:setDelay
- GTween:setPaused
- GTween:setPosition
- GTween:setValue
- GTween:setValues
- GTween:swapValues
- GTween:toBeginning
- GTween:toEnd