Changes

Jump to navigation Jump to search

gc:drawLine

885 bytes added, 00:36, 31 May 2011
Created page with "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. {{Since|..."
gc:'''drawLine''' is a function that is part of [[:Category:gc|gc]] (Graphics Context).

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


{{Since|3.0}}

== Syntax ==
'''functionName'''(x1, y1, x2 , y2)

{| class="wikitable"
|-
! Parameter !! Type !! Description
|-
| <u>x1</u> || number || The x-coordinate of the 1st point.
|-
| <u>y1</u> || number || The y-coordinate of the 1st point.
|-
| <u>x2</u> || number || The x-coordinate of the 2nd point.
|-
| <u>y2</u> || number || The y-coordinate of the 2nd point.
|}

== Example ==
<syntaxhighlight>gc:drawLine(0, 0, 100, 50)</syntaxhighlight>


== Good to know ==
This function is the one you can use in order to draw a simple point. You can do as follow :
<syntaxhighlight>gc:drawLine(20, 20, 20, 20)</syntaxhighlight>
This trick also works with [[gc:fillRect]] etc.

<br /><br />

[[Category:gc]]

Navigation menu