To combine text strings, I always use string.format, which is very slow and will cut my framerate in half when doing a lot of printing with it.
For example:
love.graphics.print(string.format("%s%s%","variable:",var),10,10)
is how I use it, and I'm wondering if there is an easier way to print out text strings and variable info in one line without having to use this long and slow process?
Oh, I just figured it out by reading a small section of the Lua manual thing. To anybody else needing this, here's how you do it instead of the method above:
love.graphics.print("variable:"..var,500,500)
Combining love.graphics.print text strings?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Combining love.graphics.print text strings?
Last edited by Jack on Tue Nov 06, 2012 3:59 am, edited 1 time in total.
Re: Combining love.graphics.print text strings?
Have you not tried using .. to concatenate strings?
love.graphics.print(variable .. var,10,10)
Is that not what you're looking for?
love.graphics.print(variable .. var,10,10)
Is that not what you're looking for?
Who is online
Users browsing this forum: Google Adsense [Bot] and 3 guests