Legacy:Triangle: Difference between revisions

From Spherical
Jump to navigation Jump to search
Created page with "Draws a triangle on the framebuffer. ==Usage== {{Usage|func=Tirangle|params=x1, y1, x2, y2, x3, y2, color}} * '''x1''' the X coordinate of the first vertex. * '''y1''' the ..."
 
→Usage: typo, param types
 
Line 3: Line 3:
==Usage==
==Usage==


{{Usage|func=Tirangle|params=x1, y1, x2, y2, x3, y2, color}}
{{Usage|func=Triangle|params=x1, y1, x2, y2, x3, y2, color}}


* '''x1''' the X coordinate of the first vertex.
* '''x1''' integer. the X coordinate of the first vertex.
* '''y1''' the Y coordinate of the first vertex.
* '''y1''' integer. the Y coordinate of the first vertex.
* '''x2''' the X coordinate of the second vertex.
* '''x2''' integer. the X coordinate of the second vertex.
* '''y2''' the Y coordinate of the second vertex.
* '''y2''' integer. the Y coordinate of the second vertex.
* '''x3''' the X coordinate of the third vertex.
* '''x3''' integer. the X coordinate of the third vertex.
* '''y3''' the Y coordinate of the third vertex.
* '''y3''' integer. the Y coordinate of the third vertex.
* '''color''' a [[API:Color|color object]] created with [[API:CreateColor|CreateColor]]
* '''color''' [[API:Color|Color]]. a [[API:Color|color object]] created with [[API:CreateColor|CreateColor]]


==Notes==
==Notes==

Latest revision as of 23:40, 11 September 2013

Draws a triangle on the framebuffer.

Usage

Triangle(x1, y1, x2, y2, x3, y2, color);


  • x1 integer. the X coordinate of the first vertex.
  • y1 integer. the Y coordinate of the first vertex.
  • x2 integer. the X coordinate of the second vertex.
  • y2 integer. the Y coordinate of the second vertex.
  • x3 integer. the X coordinate of the third vertex.
  • y3 integer. the Y coordinate of the third vertex.
  • color Color. a color object created with CreateColor

Notes

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

Examples

Draw a triangle on the screen:

var Red = CreateColor(255, 0, 0, 255);
Triangle(16, 16, 32, 32, 16, 32, Red);

See also

API:Video/navbox