1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transistional//EN"><html><head><title>OpenLayer Offline Manual</title><style type="text/css" media="all">@import "../CrystalStyle.css";</style><body bgcolor="FFFFFF" ><div align="center" style="pagestyle"><table width="60%"><tr><td><div class="parentLinks"><a href="../index.html">OpenLayer</a> | <a href="../Shape.html">Shape</a> | <a href="../Shape/Line.html">Line</a></div><br><div class="BigHeader">Line</div><br><div class=""><div class="Surrounded"><table><tr valign="top"><td align="right"><div class="FuncDef"><strong><a href="../Shape/Line.html"><font color="#0000CC">Line</font></a>(</strong></div></td><td><div class="FuncDef"><strong><font color="#777733">float</font> x1, <font color="#777733">float</font> y1, <font color="#777733">float</font> x2, <font color="#777733">float</font> y2, <font color="#777733">float</font> lineWidth = <font color="#994400">1.0</font> )
<br></strong></div></td></tr></table>
<br>Create a new line with starting point of (x1, y1) and ending point (x2, y2).
<br></div>
<br><div class="Surrounded"><table><tr valign="top"><td align="right"><div class="FuncDef"><strong><a href="../Shape/Line.html"><font color="#0000CC">Line</font></a>(</strong></div></td><td><div class="FuncDef"><strong><a href="../Vec2D.html"><font color="#0000CC">Vec2D</font></a> start, <a href="../Vec2D.html"><font color="#0000CC">Vec2D</font></a> end, <font color="#777733">float</font> lineWidth = <font color="#994400">1.0</font> )
<br></strong></div></td></tr></table>
<br>Create a new line with the specified starting point, ending point and with.
<br></div>
<br><div class="Surrounded"><table><tr valign="top"><td align="right"><div class="FuncDef"><strong>Public fields
<br></strong></div></td></tr></table>Vec2D start - The starting point of the line
<br>Vec2D end - The end point of the line
<br></div>
<br>See the examples of how to simply render a line to the screen by using a temporary object.</div><br><div class="MediumHeader">Examples</div><br><div class="Code"><font color="#999922">// Create a new line between x = 50.0, y = 30.0 //</font>
<br><font color="#999922">// and x = 200.0, y = 100.0 ( and line width of 1.0 ) //</font>
<br><a href="../Shape/Line.html"><font color="#0000CC">Line</font></a> myLine( <font color="#994400">50.0</font>, <font color="#994400">30.0</font>, <font color="#994400">200.0</font>, <font color="#994400">100.0</font> );
<br>
<br><font color="#999922">// Draw that line to the screen in black //</font>
<br>myLine.<a href="../Poly/Draw.html"><font color="#0000CC">Draw</font></a>( <a href="../Rgba.html"><font color="#0000CC">Rgba</font></a>::BLACK );
<br>
<br><font color="#999922">// Do the same as above but with a single code line //</font>
<br><a href="../Shape/Line.html"><font color="#0000CC">Line</font></a>( <font color="#994400">50.0</font>, <font color="#994400">30.0</font>, <font color="#994400">200.0</font>, <font color="#994400">100.0</font> ).<a href="../Poly/Draw.html"><font color="#0000CC">Draw</font></a>( <a href="../Rgba.html"><font color="#0000CC">Rgba</font></a>::BLACK );
<br>
<br><font color="#999922">// Or maybe you wish to store or specify the start and ending points as vectors //</font>
<br><a href="../Shape/Line.html"><font color="#0000CC">Line</font></a>( <a href="../Vec2D.html"><font color="#0000CC">Vec2D</font></a>( <font color="#994400">50.0</font>, <font color="#994400">30.0</font> ), <a href="../Vec2D.html"><font color="#0000CC">Vec2D</font></a>( <font color="#994400">200.0</font>, <font color="#994400">100.0</font> )).<a href="../Poly/Draw.html"><font color="#0000CC">Draw</font></a>( <a href="../Rgba.html"><font color="#0000CC">Rgba</font></a>::BLACK );</div><div class=""><br><br><div class="MediumHeader">Member functions</div><div class="Surrounded"><table size="100%" cellpadding="0" cellspacing="0"><tr><td halign="center" class="funclist"><a href="../Line/Draw.html">Draw</a></td><td width="65%" halign="center"><div class="smalltext">Draws the line to the screen filled with a color</div></td></tr><tr><td halign="center" class="funclist"><a href="../Line/GetIntersectionPoint.html">GetIntersectionPoint</a></td><td width="65%" halign="center"><div class="smalltext">Returns the intersection point between two lines</div></td></tr><tr><td halign="center" class="funclist"><a href="../Line/Collides.html">Collides</a></td><td width="65%" halign="center"><div class="smalltext">Tests if the two line segments collide</div></td></tr><tr><td halign="center" class="funclist"><a href="../Line/GetNormal.html">GetNormal</a></td><td width="65%" halign="center"><div class="smalltext">Returns the normal of the line</div></td></tr></table></div><br><div class="MediumHeader">Parent Class</div><div class="Surrounded"><a href="../Shape.html">Shape</a></div><br><div class=""><a href="../index.html">Back to the main page of the manual</a></div><br>Questions about Line? Click <a href="http://crystalstorm.ath.cx/index.php?lan=en&page=CreateFeedback&subject=Line">here.</a></div></td></tr></table></body></html>
|