DrawText (Harvest)

From OxeyeWiki

(Difference between revisions)
Jump to: navigation, search
(Created page with '{{HarvestMethod | harvest.drawText(string, x, y[, alignment[, r, g, b[, a]]]) | Adds a text line to the render queue. These texts are drawn after the game, but before all other G...')
Line 1: Line 1:
{{HarvestMethod
{{HarvestMethod
|
|
-
harvest.drawText(string, x, y[, alignment[, r, g, b[, a]]])
+
nil harvest.drawText(text, x, y[, alignment[, r, g, b[, a]]])
|
|
Adds a text line to the render queue. These texts are drawn after the game, but before all other GUI. The 'alignment' parameter can either be 0 for left-, 1 for center- or 2 for right-aligned. RGBA parameters are given in the range from 0 to 255, and defaults to full opaque white color.
Adds a text line to the render queue. These texts are drawn after the game, but before all other GUI. The 'alignment' parameter can either be 0 for left-, 1 for center- or 2 for right-aligned. RGBA parameters are given in the range from 0 to 255, and defaults to full opaque white color.
|
|
-
{{MethodParam|string|A string|The text to draw.}}
+
{{MethodParam|text|String|The text to draw.}}
-
{{MethodParam|x|An integer|The x coordinate.}}
+
{{MethodParam|x|Number|The x coordinate.}}
-
{{MethodParam|y|An integer|The y coordinate.}}
+
{{MethodParam|y|Number|The y coordinate.}}
-
{{MethodParam|alignment|An integer|The alignment of the text, 0 is left-, 1 is center- and 2 is right-aligned.}}
+
{{MethodParam|alignment|Number|The alignment of the text, 0 is left-, 1 is center- and 2 is right-aligned.}}
-
{{MethodParam|a|An integer|The text color's alpha component, 0 is min and 255 is max.}}
+
{{MethodParam|r|Number|The text color's red component, 0 is min and 255 is max.}}
-
{{MethodParam|r|An integer|The text color's red component, 0 is min and 255 is max.}}
+
{{MethodParam|g|Number|The text color's green component, 0 is min and 255 is max.}}
-
{{MethodParam|g|An integer|The text color's green component, 0 is min and 255 is max.}}
+
{{MethodParam|b|Number|The text color's blue component, 0 is min and 255 is max.}}
-
{{MethodParam|b|An integer|The text color's blue component, 0 is min and 255 is max.}}
+
{{MethodParam|a|Number|The text color's alpha component, 0 is min and 255 is max.}}
|
|
Returns nothing.
Returns nothing.

Revision as of 21:49, 1 December 2009

nil harvest.drawText(text, x, y[, alignment[, r, g, b[, a]]])

Adds a text line to the render queue. These texts are drawn after the game, but before all other GUI. The 'alignment' parameter can either be 0 for left-, 1 for center- or 2 for right-aligned. RGBA parameters are given in the range from 0 to 255, and defaults to full opaque white color.

Parameter Expected Type Description
text String The text to draw.
x Number The x coordinate.
y Number The y coordinate.
alignment Number The alignment of the text, 0 is left-, 1 is center- and 2 is right-aligned.
r Number The text color's red component, 0 is min and 255 is max.
g Number The text color's green component, 0 is min and 255 is max.
b Number The text color's blue component, 0 is min and 255 is max.
a Number The text color's alpha component, 0 is min and 255 is max.
Returns

Returns nothing.

Harvest Library

Example

   harvest.drawText("Timer is now: " .. timer, 100, 100, 0, 255, 255, 0, 255)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox