Scrolling text

Is there an API for making scrolling text.

I would like to make a “Credits” screen. So either scrolling paragraphs of text from the bottom up like at the end of a movie, or text scrolling across the screen like a stock exchange banner. [import]uid: 63413 topic_id: 11572 reply_id: 311572[/import]

It’s more costly memory-wise, but if you don’t have too many credits, render each line into an image and scroll them from bottom to top. Scale them down as they approach the top for the star wars effect.

If you render your own, you won’t have to worry about the font being available on whatever platform is running your game in the future. [import]uid: 58455 topic_id: 11572 reply_id: 42020[/import]

You can create a tall block of text (for a credits screen) or a long block of text (for a stock ticker) then position them at the bottom or right side of the screen, respectively, and then use transition.to to make them move up or to the left.

Using the paragraph feature of the Crawl Space Library, here’s a scrolling credit-type thing that scrolls up and then fades away as it finishes.

[lua]local crawlspaceLib = require(“crawlspaceLib”)

display.setStatusBar(display.HiddenStatusBar)

local format = {}
format.font = flyer
format.size = 36
format.lineHeight = 2
format.align = “center”

local myParagraph = display.newParagraph( “Welcome to the Crawl Space Library, where all of your Corona SDK coding dreams will come true, we guarantee it!”, 15, format)
myParagraph:center(“x”)
myParagraph.y = 400
myParagraph:fadeIn()

transition.to ( myParagraph, { time = 12000, y = -300 } )
timer.performWithDelay ( 10000, function() myParagraph:fadeOut(2000) end )[/lua]

Jay
[import]uid: 9440 topic_id: 11572 reply_id: 42047[/import]

Hi Jay,

This helped a lot, thanks! I’m bringing my text in from a separate string and am trying to figure out how to do line breaks. Tried \n but that isn’t working.

Also, where do you set the text color? [import]uid: 14032 topic_id: 11572 reply_id: 44274[/import]