diff options
| author | Ray <[email protected]> | 2019-05-20 16:36:42 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2019-05-20 16:36:42 +0200 |
| commit | b525039e0ab8bcaa2fd6bde34c72a6405f88ae49 (patch) | |
| tree | 08f1c79bfe693643564ed78202c9474b7eb83a79 /examples/shapes/shapes_draw_rectangle_rounded.c | |
| parent | a43a7980a30a52462956b23f2473e8ef8f38d1fb (diff) | |
| download | raylib-b525039e0ab8bcaa2fd6bde34c72a6405f88ae49.tar.gz raylib-b525039e0ab8bcaa2fd6bde34c72a6405f88ae49.zip | |
Review ALL examples
Diffstat (limited to 'examples/shapes/shapes_draw_rectangle_rounded.c')
| -rw-r--r-- | examples/shapes/shapes_draw_rectangle_rounded.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/examples/shapes/shapes_draw_rectangle_rounded.c b/examples/shapes/shapes_draw_rectangle_rounded.c index e36e2731..c183e88b 100644 --- a/examples/shapes/shapes_draw_rectangle_rounded.c +++ b/examples/shapes/shapes_draw_rectangle_rounded.c @@ -30,12 +30,12 @@ int main(void) int height = 100; int segments = 0; int lineThick = 1; - + bool drawRect = false; bool drawRoundedRect = true; bool drawRoundedLines = false; - SetTargetFPS(60); + SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- // Main game loop @@ -45,20 +45,20 @@ int main(void) //---------------------------------------------------------------------------------- Rectangle rec = { (GetScreenWidth() - width - 250)/2, (GetScreenHeight() - height)/2, width, height }; //---------------------------------------------------------------------------------- - + // Draw //---------------------------------------------------------------------------------- BeginDrawing(); - + ClearBackground(RAYWHITE); - + DrawLine(560, 0, 560, GetScreenHeight(), Fade(LIGHTGRAY, 0.6f)); DrawRectangle(560, 0, GetScreenWidth() - 500, GetScreenHeight(), Fade(LIGHTGRAY, 0.3f)); if (drawRect) DrawRectangleRec(rec, Fade(GOLD, 0.6)); if (drawRoundedRect) DrawRectangleRounded(rec, roundness, segments, Fade(MAROON, 0.2)); if (drawRoundedLines) DrawRectangleRoundedLines(rec,roundness, segments, lineThick, Fade(MAROON, 0.4)); - + // Draw GUI controls //------------------------------------------------------------------------------ width = GuiSliderBar((Rectangle){ 640, 40, 105, 20 }, "Width", width, 0, GetScreenWidth() - 300, true ); @@ -66,22 +66,22 @@ int main(void) roundness = GuiSliderBar((Rectangle){ 640, 140, 105, 20 }, "Roundness", roundness, 0.0f, 1.0f, true); lineThick = GuiSliderBar((Rectangle){ 640, 170, 105, 20 }, "Thickness", lineThick, 0, 20, true); segments = GuiSliderBar((Rectangle){ 640, 240, 105, 20}, "Segments", segments, 0, 60, true); - + drawRoundedRect = GuiCheckBox((Rectangle){ 640, 320, 20, 20 }, "DrawRoundedRect", drawRoundedRect); drawRoundedLines = GuiCheckBox((Rectangle){ 640, 350, 20, 20 }, "DrawRoundedLines", drawRoundedLines); drawRect = GuiCheckBox((Rectangle){ 640, 380, 20, 20}, "DrawRect", drawRect); //------------------------------------------------------------------------------ - + DrawText(FormatText("MODE: %s", (segments >= 4)? "MANUAL" : "AUTO"), 640, 280, 10, (segments >= 4)? MAROON : DARKGRAY); - + DrawFPS(10, 10); - + EndDrawing(); //---------------------------------------------------------------------------------- } // De-Initialization - //-------------------------------------------------------------------------------------- + //-------------------------------------------------------------------------------------- CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- |
