Add transition to a text

Hi

I have the following code that displays a text. I want to add an effect to it so that the text appears to grow and then returns back to original size.

  local startText = display.newText(group, “Tap To Start”, 0, 0, native.systemFont, 20);

  startText.x, startText.y = centerX, topSide+startText.contentHeight*.5;

function GoBack() transition.to(startText,{time=1000,xScale=1,yScale=1}) end transition.to(startText,{time=1000,xScale=2,yScale=2,onComplete=GoBack})

Try something like this

Yes seen this already but it only made it to transition once, I was hoping to make it continuous. Thanks

function Shrink() transition.to(startText,{time=1000,xScale=1,yScale=1,onComplete=Grow}) end function Grow() transition.to(startText,{time=1000,xScale=2,yScale=2,onComplete=Shrink}) end Grow()

This will work

Yes  yes yes, this worked. The only thing I am not sure is when I start the game and the text disappears, will it not be running in the background and may eat up memory? Is there something else I need to do to ensure that it is completely removed during game play. Thanks

Will this piece of code do the trick:

        if startText then

          transition.to(startText, {time = 200, alpha = 0, onComplete = startText.removeSelf});

          startText = nil;

        end

Just add startText to a displaygroup, so when you change scenes with composer, it will be automatically removed

function GoBack() transition.to(startText,{time=1000,xScale=1,yScale=1}) end transition.to(startText,{time=1000,xScale=2,yScale=2,onComplete=GoBack})

Try something like this

Yes seen this already but it only made it to transition once, I was hoping to make it continuous. Thanks

function Shrink() transition.to(startText,{time=1000,xScale=1,yScale=1,onComplete=Grow}) end function Grow() transition.to(startText,{time=1000,xScale=2,yScale=2,onComplete=Shrink}) end Grow()

This will work

Yes  yes yes, this worked. The only thing I am not sure is when I start the game and the text disappears, will it not be running in the background and may eat up memory? Is there something else I need to do to ensure that it is completely removed during game play. Thanks

Will this piece of code do the trick:

        if startText then

          transition.to(startText, {time = 200, alpha = 0, onComplete = startText.removeSelf});

          startText = nil;

        end

Just add startText to a displaygroup, so when you change scenes with composer, it will be automatically removed