Difference between revisions of "love.graphics.print"
(The addition at the top is good to know. Also expanded the example code.) |
|||
Line 30: | Line 30: | ||
[[Category:Functions]] | [[Category:Functions]] | ||
{{#set:Description=Draws text on screen. If no Font is set, one will be created and set (once) if needed.}} | {{#set:Description=Draws text on screen. If no Font is set, one will be created and set (once) if needed.}} | ||
+ | {{#set:Since=000}} | ||
== Other Languages == | == Other Languages == | ||
{{i18n|love.graphics.print}} | {{i18n|love.graphics.print}} |
Revision as of 10:18, 25 March 2011
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.
Contents
Function
Synopsis
love.graphics.print( text, x, y, r, sx, sy )
Arguments
string text
- The text to draw.
number x
- The position to draw the object (x-axis).
number y
- The position to draw the object (y-axis).
number r (0)
- Orientation (radians).
number sx (1)
- Scale factor (x-axis).
number sy (sx)
- Scale factor (y-axis).
Returns
Nothing.
Examples
A lame example
function love.draw()
love.graphics.print("This is a pretty lame example.", 10, 200)
love.graphics.print("This lame example is twice as big.", 10, 250, 0, 2, 2)
love.graphics.print("This example is lamely vertical.", 300, 30, math.pi/2)
end
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