Updated show-logo and start reviewing RPI inputs

This commit is contained in:
raysan5 2016-02-13 19:14:22 +01:00
parent 30fafb77db
commit 0018522031
3 changed files with 17 additions and 47 deletions

View file

@ -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)
{