Difference between revisions of "gc:drawString"

From Inspired-Lua Wiki
Jump to navigation Jump to search
m (Text replace - "| <u>" to "| <u><center>")
m (Text replace - "</u> ||" to "</center></u> ||")
Line 13: Line 13:
 
! Parameter !! Type !! Description
 
! Parameter !! Type !! Description
 
|-
 
|-
| <u><center>string</u> || string || The text to display
+
| <u><center>string</center></u> || string || The text to display
 
|-
 
|-
| <u><center>x</u> || number || the ''x'' coordinate of the beginning of the string. Relative to ''position''.
+
| <u><center>x</center></u> || number || the ''x'' coordinate of the beginning of the string. Relative to ''position''.
 
|-
 
|-
| <u><center>y</u> || number || the ''y'' coordinate of the beginning of the string. Relative to ''position''.
+
| <u><center>y</center></u> || number || the ''y'' coordinate of the beginning of the string. Relative to ''position''.
 
|-
 
|-
| <u><center>position</u> || string || the string’s anchor point. It can either be "baseline", “bottom”, “middle”, or “top”.
+
| <u><center>position</center></u> || string || the string’s anchor point. It can either be "baseline", “bottom”, “middle”, or “top”.
 
|}
 
|}
 
== Example  ==
 
== Example  ==

Revision as of 00:41, 31 May 2011

drawString is a function that is part of gc (Graphics Context).

This function is used to display text, numbers etc. on the screen at specified coordinates.


This has been introduced in TI-Nspire OS 3.0 (Changes).


Syntax

gc:drawString(string, x, y [,position])

Parameter Type Description
string
string The text to display
x
number the x coordinate of the beginning of the string. Relative to position.
y
number the y coordinate of the beginning of the string. Relative to position.
position
string the string’s anchor point. It can either be "baseline", “bottom”, “middle”, or “top”.

Example

gc:drawString("Hello World", 0, 0, "top")

will display    Hello World     at the top-left part of the screen.