Hi all, first post here - be gentle!
I am trying to achieve a radom placement of images, with each image then constantly fading in and out.
i am nearly there, i have the images appearing in random positions, the images then fade to alpha 0.5, however only the last image then fades back in to full alpha 1.
My code is below, all help appreciated.
[code] – STAR
local function newStar ( event )
local menuStar = display.newImageRect( “images/star.png”, 11, 10 )
menuStar.x = mRand(50, _W-50); menuStar.y = mRand(50, _H-10);
menuGroup:insert( menuStar )
– STAR FADE ANIMATION
if starIn then
transition.cancel( starIn )
end
local function starFade ()
local starShine = function ()
starIn = transition.to( menuStar, { time=1400, delay=900, alpha=1.0, onComplete=starFade })
end
starIn = transition.to( menuStar, { time=1400, alpha=0, onComplete=starShine })
end
starFade()
end
timer.performWithDelay(1000, newStar, 13)
– END STAR FADE
[/code] [import]uid: 113162 topic_id: 21220 reply_id: 321220[/import]
[import]uid: 52491 topic_id: 21220 reply_id: 84156[/import]