gc:drawLine

From Inspired-Lua Wiki
Jump to: navigation, search

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

It basically draws a line between the two points defined by their coordinates.


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


Syntax[edit]

functionName(x1, y1, x2 , y2)

Parameter Type Description
x1
number The x-coordinate of the 1st point.
y1
number The y-coordinate of the 1st point.
x2
number The x-coordinate of the 2nd point.
y2
number The y-coordinate of the 2nd point.

Example[edit]

gc:drawLine(0, 0, 100, 50)


Good to know[edit]

This function is the one you can use in order to draw a simple point. You can do as follow :

gc:drawLine(20, 20, 20, 20)

This trick also works with gc:fillRect etc.