Heya,
The current transition library is great, and for most purposes it’s pretty complete. I’ve got a few extra things I’d love to see it support, such as changing color or more support for bezier curve movement. However I can understand that adding support for them adds bloat to the library which most developers won’t use.
But by adding support for an extra callback function which gets called every frame developers could easily implement these features themselves in very few lines of code.
The callback can use a very similar signature to the existing onComplete callback. All that most people would need would be the subject of the transition and a numerical expression of how far through the transition we currently are (basically a number between 0 and 1).
Here’s how I think it could work:
[code]
local rect=display.newRect(10,10,10,10)
rect:setFillColor(255,0,0)
transition.to(rect,{onFrame=function(obj, ratio)
local r=255-ratio*128
local b=255*ratio
obj:setFillColor(r,0,b)
end})
[/code] [import]uid: 11757 topic_id: 18083 reply_id: 318083[/import]