Difference between revisions of "Legacy:Line"

From Spherical
Jump to: navigation, search
(Created initial page)
 
(added navbox)
 
Line 32: Line 32:
 
* [[API:FlipScreen|FlipScreen]]()
 
* [[API:FlipScreen|FlipScreen]]()
  
[[Category:Functions]]
+
{{API:Video/navbox}}

Latest revision as of 21:09, 4 June 2013

Draws a line to screen at location x1, y1, to location x2, y2 with a certain color.

Usage

Line(x1, y1, x2, y2, color);


  • x1 the X coordinate, start of line
  • y1 the Y coordinate, start of line
  • x2 the X coordinate, end of line
  • y2 the Y coordinate, end of line
  • color a color object created with CreateColor

Notes

Remember that FlipScreen must be called before any drawing is visible on the screen.

Examples

A red diagonal line.

var Red = CreateColor(255, 0, 0);
Line(0, 0, GetScreenWidth(), GetScreenHeight(), Red);

See also

API:Video/navbox