Code: Select all
function love.draw(dt)
love.graphics.print( "First of all: " .. endline .. " 1. Blah Blah Blah" .. endline .. " 2. Blah Blah Blah" )
end
Code: Select all
function love.draw(dt)
love.graphics.print( "First of all: " .. endline .. " 1. Blah Blah Blah" .. endline .. " 2. Blah Blah Blah" )
end
Code: Select all
"\n"
Code: Select all
function love.draw(dt)
love.graphics.print( "First of all:\n 1. Blah Blah Blah\n 2. Blah Blah Blah" )
end
WHAT !? I really had no idea because I'm new at LUApgimeno wrote: ↑Sat Oct 05, 2019 8:52 pm What's wrong withitself?Code: Select all
"\n"
This works for me:Code: Select all
function love.draw(dt) love.graphics.print( "First of all:\n 1. Blah Blah Blah\n 2. Blah Blah Blah" ) end
Code: Select all
local myText = [[this is where my text goes
and it will handle linebreaks]]
function love.draw ()
love.graphics.print(myText, 10, 10)
end
Code: Select all
function love.draw ()
love.graphics.print([[this is where my text goes
and it will handle linebreaks]], 10, 10)
end
Oh! Thank you, by the way that was the quickest response I ever seen =)MrFariator wrote: ↑Sun Oct 06, 2019 11:12 amOne thing to keep in mind is that all contents between [[]] will be caught, so it will also take the indentation into account if present. Example:Code: Select all
local myText = [[this is where my text goes and it will handle linebreaks]] function love.draw () love.graphics.print(myText, 10, 10) end
...will look like this (second line is offset by the indentation present in the code):Code: Select all
function love.draw () love.graphics.print([[this is where my text goes and it will handle linebreaks]], 10, 10) end
You can work around this by just writing the text into a local variable in a non-indented position, like in the first example.
Users browsing this forum: No registered users and 213 guests