Hai people!
I try to imitate those oldschool scrolling dialogue windows (with the glyphs appearing one after another quickly). I only want two lines of text being visible at once, after that an user input is necessary to continue to the next two lines.
I use printf for line wrapping. How can I stop outputting the string after one line feed?
Many thanks in advance!
Robert
printf: number of line wraps
Re: printf: number of line wraps
I would suggest you to use love functions for printing text.McMalloc wrote:Hai people!
I try to imitate those oldschool scrolling dialogue windows (with the glyphs appearing one after another quickly). I only want two lines of text being visible at once, after that an user input is necessary to continue to the next two lines.
I use printf for line wrapping. How can I stop outputting the string after one line feed?
Many thanks in advance!
Robert
As for your question, you will need to play with string.sub, string.len and probably with font:getWidth() and also having some variable where you save the maximum number of characters per line and the maximun width of the line. And maybe with love.timer.sleep() too.
Re: printf: number of line wraps
I forgot to state that I indeed use love.graphics.printf() to display text with line wrappingUbermann wrote: I would suggest you to use love functions for printing text.
As for your question, you will need to play with string.sub, string.len and probably with font:getWidth() and also having some variable where you save the maximum number of characters per line and the maximun width of the line. And maybe with love.timer.sleep() too.
Font.getWidth() seems to look useful for this purpose, thank you! But why would I need sleep()? I don't want the dialogue display to freeze the whole program...
Regards,
Robert
Who is online
Users browsing this forum: Google [Bot] and 3 guests