Files
processing4/mobile/web/reference/API/line.xml
2005-01-27 06:48:42 +00:00

88 lines
1.8 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>line()</name>
<category>Shape</category>
<subcategory>2D Primitives</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>line_.gif</image>
<code>
line(30, 20, 85, 75);
</code>
</example>
<example>
<image>line_2.gif</image>
<code>
line(30, 20, 85, 20);
stroke(126);
line(85, 20, 85, 75);
stroke(255);
line(85, 75, 30, 75);
</code>
</example>
<description>
A line is a direct path between two points. The version of <b>line()</b> with four parameters draws the line in the XY plane at Z=0. The version with six parameters allows the line to be placed anywhere within XYZ space. To color a line, use the <b>stroke()</b> function. A line cannot be filled, therefore the <b>fill()</b> method will not affect the color of a line. Lines are drawn with a width of one pixel.
</description>
<syntax>
line(<c>x1</c>, <c>y1</c>, <c>x2</c>, <c>y2</c>);
line(<c>x1</c>, <c>y1</c>, <c>z1</c>, <c>x2</c>, <c>y2</c>, <c>z2</c>);
</syntax>
<parameter>
<label>x1</label>
<description>int or float: x-coordinate of the first point</description>
</parameter>
<parameter>
<label>y1</label>
<description>int or float: y-coordinate of the first point</description>
</parameter>
<parameter>
<label>z1</label>
<description>int or float: z-coordinate of the first point</description>
</parameter>
<parameter>
<label>x2</label>
<description>int or float: x-coordinate of the second point</description>
</parameter>
<parameter>
<label>y2</label>
<description>int or float: y-coordinate of the second point</description>
</parameter>
<parameter>
<label>z2</label>
<description>int or float: z-coordinate of the second point</description>
</parameter>
<returns>None</returns>
<related>
beginShape()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>