OpenLayer Offline Manual

OpenLayer | Shape | Line | Draw Draw
void Draw( | Rgba color ) const
Draws the circle to the screen filled with a color.
void Draw( | const Rgba &startColor, const Rgba &endColor ) const
Draws the line with the color smoothly changing from start of the line to the end 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 ); // Draw that line to the screen in light yellow // myLine.Draw( Rgba( 1.0, 1.0, 0.7 )); // Do the same as above but with a single code line // Line( 50.0, 30.0, 200.0, 100.0 ).Draw( Rgba( 1.0, 1.0, 0.7 )); // Render a gradient-filled line with the color changing from red to yellow // myLine.Draw( Rgba::RED, Rgba::YELLOW ); Other functions of the class Line
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
Back to the main page of the manual Questions about Draw? Click here.