OpenLayer Offline Manual

OpenLayer | Shape | Rect Rect
Rect( | float x, float y, float w, float h, float outlineWidth = 1.0, float roundness = 0.0 float accuracy = [default] )
Creates a new rectangle with the specified position for the top-left corner, width and roundness. Line width specifies the width of the outline of the rectangle (See DrawOutline). Accuracy parameter specifies the accuracy of the corners of a rounded rectangle.
Rect( | Vec2D topleft, Vec2D size, float lineWidth = 1.0, float roundness = 0.0 float accuracy = [default] )
Same as above but the position and the size are specified with vectors. Examples // Create a new rectangle with top-left corner at x = 200.0, y = 100.0 // // and size of 300.0 x 400.0 // Rect myRectangle( 200.0, 100.0, 300.0, 400.0 ); // Render the rectangle to the drawing surface filled with white // myRectangle.Draw( Rgba::WHITE ); // You can also create the rectangle and render it in a single line: // Rect( 200.0, 100.0, 300.0, 400.0 ).Draw( Rgba::WHITE ); // Create a new rectangle by using vectors // Vec2D topleft( 200.0, 100.0 ); Vec2D size( 300.0, 400.0 ); Rect myRectangle( topleft, size ); // Or the above with only a single line: // Rect myRectangle( Vec2D( 200.0, 100.0 ), Vec2D( 300.0, 400.0 )); Member functions
Draw | Draws a filled rectangle
DrawOutline | Draws an outline of the rectangle
SetAccuracy | Sets the accuracy of the rounded edges
SetRoundness | Sets the roundness of the corners
Parent Class Shape Back to the main page of the manual Questions about Rect? Click here.