What would be the best way to make something blink?
Also where would I find reference for these types of animations? [import]uid: 1380 topic_id: 10060 reply_id: 310060[/import]
What would be the best way to make something blink?
Also where would I find reference for these types of animations? [import]uid: 1380 topic_id: 10060 reply_id: 310060[/import]
Take a look at transition.to – it be your friend for things like that:
http://developer.anscamobile.com/reference/index/transitionto
To make something blink you could set the alpha to 0 and back to 1, or you could set isVisible to false and then back to true (not sure you can mess with isVisible with transition.to). You could also set the location to offscreen and then back on after a short delay.
Lots of ways to make things blink.
Jay [import]uid: 9440 topic_id: 10060 reply_id: 36737[/import]
Thanks. I’ll look into it. Just found this example:
-- Create rectangle
r = display.newRect( 0, 0, display.contentWidth, display.contentHeight )
r:setFillColor( 255, 255, 255 )
local function repeatFade (event)
r.alpha = 1
transition.to( r, { alpha=0, time=1000 } )
end
-- Fade out rectangle every second 20x using transition.to()
timer.performWithDelay(1000, repeatFade, 0 )
Change the “0” after “repeatFade” to some number if you need it to fade a certain amount of times. “0” is infinity. [import]uid: 1380 topic_id: 10060 reply_id: 36739[/import]