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_colors_palette.c | |
| parent | a43a7980a30a52462956b23f2473e8ef8f38d1fb (diff) | |
| download | raylib-b525039e0ab8bcaa2fd6bde34c72a6405f88ae49.tar.gz raylib-b525039e0ab8bcaa2fd6bde34c72a6405f88ae49.zip | |
Review ALL examples
Diffstat (limited to 'examples/shapes/shapes_colors_palette.c')
| -rw-r--r-- | examples/shapes/shapes_colors_palette.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/shapes/shapes_colors_palette.c b/examples/shapes/shapes_colors_palette.c index d6ac30a9..7322f7e5 100644 --- a/examples/shapes/shapes_colors_palette.c +++ b/examples/shapes/shapes_colors_palette.c @@ -13,7 +13,7 @@ #define MAX_COLORS_COUNT 21 // Number of colors available -int main() +int main(void) { // Initialization //-------------------------------------------------------------------------------------- @@ -22,14 +22,14 @@ int main() InitWindow(screenWidth, screenHeight, "raylib [shapes] example - colors palette"); - Color colors[MAX_COLORS_COUNT] = { + Color colors[MAX_COLORS_COUNT] = { DARKGRAY, MAROON, ORANGE, DARKGREEN, DARKBLUE, DARKPURPLE, DARKBROWN, GRAY, RED, GOLD, LIME, BLUE, VIOLET, BROWN, LIGHTGRAY, PINK, YELLOW, GREEN, SKYBLUE, PURPLE, BEIGE }; - - const char *colorNames[MAX_COLORS_COUNT] = { - "DARKGRAY", "MAROON", "ORANGE", "DARKGREEN", "DARKBLUE", "DARKPURPLE", - "DARKBROWN", "GRAY", "RED", "GOLD", "LIME", "BLUE", "VIOLET", "BROWN", + + const char *colorNames[MAX_COLORS_COUNT] = { + "DARKGRAY", "MAROON", "ORANGE", "DARKGREEN", "DARKBLUE", "DARKPURPLE", + "DARKBROWN", "GRAY", "RED", "GOLD", "LIME", "BLUE", "VIOLET", "BROWN", "LIGHTGRAY", "PINK", "YELLOW", "GREEN", "SKYBLUE", "PURPLE", "BEIGE" }; Rectangle colorsRecs[MAX_COLORS_COUNT] = { 0 }; // Rectangles array @@ -69,19 +69,19 @@ int main() BeginDrawing(); ClearBackground(RAYWHITE); - + DrawText("raylib colors palette", 28, 42, 20, BLACK); DrawText("press SPACE to see all colors", GetScreenWidth() - 180, GetScreenHeight() - 40, 10, GRAY); for (int i = 0; i < MAX_COLORS_COUNT; i++) // Draw all rectangles { DrawRectangleRec(colorsRecs[i], Fade(colors[i], colorState[i]? 0.6f : 1.0f)); - - if (IsKeyDown(KEY_SPACE) || colorState[i]) + + if (IsKeyDown(KEY_SPACE) || colorState[i]) { DrawRectangle(colorsRecs[i].x, colorsRecs[i].y + colorsRecs[i].height - 26, colorsRecs[i].width, 20, BLACK); DrawRectangleLinesEx(colorsRecs[i], 6, Fade(BLACK, 0.3f)); - DrawText(colorNames[i], colorsRecs[i].x + colorsRecs[i].width - MeasureText(colorNames[i], 10) - 12, + DrawText(colorNames[i], colorsRecs[i].x + colorsRecs[i].width - MeasureText(colorNames[i], 10) - 12, colorsRecs[i].y + colorsRecs[i].height - 20, 10, colors[i]); } } |
