Draws text on screen. If no Font is set, one will be created and set (once) if needed.
As of LOVE 0.7.1, when using translation and scaling functions while drawing text, this function assumes the scale occurs first. If you don't script with this in mind, the text won't be in the right position, or possibly even on screen.
love.graphics.print and love.graphics.printf both support UTF-8 encoding. You'll also need a proper Font for special characters.
In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.
![]() |
Text may appear blurry if it's rendered at non-integer pixel locations. |
love.graphics.print( text, x, y, r, sx, sy, ox, oy, kx, ky )
string text
number x (0)
number y (0)
number r (0)
number sx (1)
number sy (sx)
number ox (0)
number oy (0)
number kx (0)
number ky (0)
Nothing.
Available since LÖVE 0.10.0 |
This variant is not supported in earlier versions. |
love.graphics.print( coloredtext, x, y, angle, sx, sy, ox, oy, kx, ky )
table coloredtext
{color1, string1, color2, string2, ...}
.
table color1
{red, green, blue, alpha}
.string string1
table color2
{red, green, blue, alpha}
.string string2
tables and strings ...
number x (0)
number y (0)
number angle (0)
number sx (1)
number sy (sx)
number ox (0)
number oy (0)
number kx (0)
number ky (0)
Nothing.
The color set by love.graphics.setColor will be combined (multiplied) with the colors of the text.
Available since LÖVE 11.0 |
This variant is not supported in earlier versions. |
love.graphics.print( text, transform )
string text
Transform transform
Nothing.
Available since LÖVE 11.0 |
This variant is not supported in earlier versions. |
love.graphics.print( coloredtext, transform )
table coloredtext
{color1, string1, color2, string2, ...}
.
table color1
{red, green, blue, alpha}
.string string1
table color2
{red, green, blue, alpha}
.string string2
tables and strings ...
Transform transform
Nothing.
The color set by love.graphics.setColor will be combined (multiplied) with the colors of the text.
Available since LÖVE 11.0 |
This variant is not supported in earlier versions. |
love.graphics.print( text, font, transform )
string text
Font font
Transform transform
Nothing.
Available since LÖVE 11.0 |
This variant is not supported in earlier versions. |
love.graphics.print( coloredtext, font, transform )
table coloredtext
{color1, string1, color2, string2, ...}
.
table color1
{red, green, blue, alpha}
.string string1
table color2
{red, green, blue, alpha}
.string string2
tables and strings ...
Nothing.
The color set by love.graphics.setColor will be combined (multiplied) with the colors of the text.
function love.draw() love.graphics.setColor(0, 1, 0, 1) love.graphics.print("This is a pretty lame example.", 10, 200) love.graphics.setColor(1, 0, 0, 1) love.graphics.print("This lame example is twice as big.", 10, 250, 0, 2, 2) love.graphics.setColor(0, 0, 1, 1) love.graphics.print("This example is lamely vertical.", 300, 30, math.pi/2) end
In version 0.8.0 and older, love.graphics.print stops at the first '\0' (null) character. This can bite you if you are appending keystrokes to form your string, as some of those are multi-byte unicode characters which will likely contain null bytes.