Difference between revisions of "love.graphics.printf"

(Add a link to love.graphics.print)
Line 16: Line 16:
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
Nothing.
 +
== Examples ==
 +
Draw text to the screen with right alignment and a horizontal limit of 125.
 +
<source lang="lua">
 +
love.graphics.printf("This text is aligned right, and wraps when it gets too big.", 25, 25, 125, "right")
 +
</source>
 
== See Also ==
 
== See Also ==
 
* [[parent::love.graphics]]
 
* [[parent::love.graphics]]

Revision as of 16:00, 31 May 2012

Draws formatted text, with word wrap and alignment.

See additional notes in love.graphics.print.

Function

Synopsis

love.graphics.printf( text, x, y, limit, align )

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.

love.graphics.printf("This text is aligned right, and wraps when it gets too big.", 25, 25, 125, "right")

See Also


Other Languages