OpenLayer Offline Manual

OpenLayer | Shape | Line Line
Line( | float x1, float y1, float x2, float y2, float lineWidth = 1.0 )
Create a new line with starting point of (x1, y1) and ending point (x2, y2).
Line( | Vec2D start, Vec2D end, float lineWidth = 1.0 )
Create a new line with the specified starting point, ending point and with.
Public fields
Vec2D start - The starting point of the line Vec2D end - The end point of the line See the examples of how to simply render a line to the screen by using a temporary object. Examples // Create a new line between x = 50.0, y = 30.0 // // and x = 200.0, y = 100.0 ( and line width of 1.0 ) // Line myLine( 50.0, 30.0, 200.0, 100.0 ); // Draw that line to the screen in black // myLine.Draw( Rgba::BLACK ); // Do the same as above but with a single code line // Line( 50.0, 30.0, 200.0, 100.0 ).Draw( Rgba::BLACK ); // Or maybe you wish to store or specify the start and ending points as vectors // Line( Vec2D( 50.0, 30.0 ), Vec2D( 200.0, 100.0 )).Draw( Rgba::BLACK ); Member functions
Draw | Draws the line to the screen filled with a color
GetIntersectionPoint | Returns the intersection point between two lines
Collides | Tests if the two line segments collide
GetNormal | Returns the normal of the line
Parent Class Shape Back to the main page of the manual Questions about Line? Click here.