aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-02-13 19:14:22 +0100
committerraysan5 <raysan5@gmail.com>2016-02-13 19:14:22 +0100
commit0018522031b8b06c447d49273bf288ec5e7a8a63 (patch)
tree105facb03f48fb5c0b93fe47f596cddb9a37137c /examples
parent30fafb77db920f165253cbd0c3a9e688fa5b93f3 (diff)
downloadraylib-0018522031b8b06c447d49273bf288ec5e7a8a63.tar.gz
raylib-0018522031b8b06c447d49273bf288ec5e7a8a63.zip
Updated show-logo and start reviewing RPI inputs
Diffstat (limited to 'examples')
-rw-r--r--examples/shapes_logo_raylib_anim.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/examples/shapes_logo_raylib_anim.c b/examples/shapes_logo_raylib_anim.c
index b1bdc3a8..c6d3796e 100644
--- a/examples/shapes_logo_raylib_anim.c
+++ b/examples/shapes_logo_raylib_anim.c
@@ -2,7 +2,7 @@
*
* raylib [shapes] example - raylib logo animation
*
-* This example has been created using raylib 1.1 (www.raylib.com)
+* This example has been created using raylib 1.4 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
@@ -32,8 +32,6 @@ int main()
int bottomSideRecWidth = 16;
int rightSideRecHeight = 16;
- char raylib[8] = " \0"; // raylib text array, max 8 letters
-
int state = 0; // Tracking animation states (State Machine)
float alpha = 1.0f; // Useful for fading
@@ -79,24 +77,13 @@ int main()
framesCounter = 0;
}
- switch (lettersCount)
- {
- case 1: raylib[0] = 'r'; break;
- case 2: raylib[1] = 'a'; break;
- case 3: raylib[2] = 'y'; break;
- case 4: raylib[3] = 'l'; break;
- case 5: raylib[4] = 'i'; break;
- case 6: raylib[5] = 'b'; break;
- default: break;
- }
-
if (lettersCount >= 10) // When all letters have appeared, just fade out everything
{
- alpha -= 0.02;
+ alpha -= 0.02f;
- if (alpha <= 0)
+ if (alpha <= 0.0f)
{
- alpha = 0;
+ alpha = 0.0f;
state = 4;
}
}
@@ -114,12 +101,7 @@ int main()
bottomSideRecWidth = 16;
rightSideRecHeight = 16;
- for (int i = 0; i < 7; i++) raylib[i] = ' ';
-
- raylib[7] = '\0'; // Last character is end-of-line
-
- alpha = 1.0;
-
+ alpha = 1.0f;
state = 0; // Return to State 0
}
}
@@ -158,7 +140,7 @@ int main()
DrawRectangle(screenWidth/2 - 112, screenHeight/2 - 112, 224, 224, Fade(RAYWHITE, alpha));
- DrawText(raylib, screenWidth/2 - 44, screenHeight/2 + 48, 50, Fade(BLACK, alpha));
+ DrawText(SubText("raylib", 0, lettersCount), screenWidth/2 - 44, screenHeight/2 + 48, 50, Fade(BLACK, alpha));
}
else if (state == 4)
{