Hello @milicchio,
Since there’s not a builti-in sine wave transition, I suggest two options:
- You build a function which repeats a “inOutQuad” easing transition in alternating directions, like this:
local object = display.newCircle( 0, 0, 10 ) ; object.x = 100 ; object.y = 160
object:setFillColor(255,0,0)
local targetY = 0 ; local time = 200
local function newTrans()
if ( targetY ~= 100 ) then targetY = 100 else targetY = 160 end
transition.to( object, { y=targetY, time=time, transition=easing.inOutQuad, onComplete=newTrans } )
end
newTrans()
- You could program in a table of “pre-determined” values based on a sine-wave pattern, and move your object using a Runtime listener. You can read about this method in the following blog post by Omid Ahourai.
http://www.coronalabs.com/blog/2012/11/13/predetermined-transitions-manual-animation/
Hope this helps somewhat,
Brent Sorrentino
[import]uid: 200026 topic_id: 33904 reply_id: 134920[/import]