Views
love.graphics.printf
Draws formatted text, with word wrap and alignment.
See additional notes in love.graphics.print.
NOTE: aligning does not work like as one might expect! It doesn't align to the x/y coordinates given, but in a rectangle. See https://love2d.org/forums/viewtopic.php?f=4&t=9709&p=59709
Function
Synopsis
Arguments
string text- A text string.
number x- The position on the x-axis.
number y- The position on the y-axis.
number limit- Wrap the line after this many horizontal pixels.
AlignMode align ("left")- The alignment.
Returns
Nothing.
Examples
Draw text to the screen with right alignment and a horizontal limit of 125.
Notes
Note that the limit argument affects the position of your text for 'center' and 'right' alignment.
love.graphics.printf("This text is aligned right",100, 100, 200,"right") -- align right to x = 100 + 200 = 300
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info