summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorAsdqwe <[email protected]>2023-08-30 17:40:49 -0300
committerGitHub <[email protected]>2023-08-30 22:40:49 +0200
commitfefe8fcda96db357ab4b93490d0453f4b3058cc6 (patch)
tree6db93ba4985e68485693d68a6712e7bea4c64077 /examples
parent46bac461cef94edf8f11bc1ea25e34a3a7feca37 (diff)
downloadraylib-fefe8fcda96db357ab4b93490d0453f4b3058cc6.tar.gz
raylib-fefe8fcda96db357ab4b93490d0453f4b3058cc6.zip
Fix examples/others/easings_testbed.c help instructions and small tweak (#3277)
Diffstat (limited to 'examples')
-rw-r--r--examples/others/easings_testbed.c22
-rw-r--r--examples/others/easings_testbed.pngbin17338 -> 17443 bytes
2 files changed, 11 insertions, 11 deletions
diff --git a/examples/others/easings_testbed.c b/examples/others/easings_testbed.c
index 227efd23..45f0efd0 100644
--- a/examples/others/easings_testbed.c
+++ b/examples/others/easings_testbed.c
@@ -108,7 +108,7 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [easings] example - easings testbed");
- Vector2 ballPosition = { 100.0f, 200.0f };
+ Vector2 ballPosition = { 100.0f, 100.0f };
float t = 0.0f; // Current time (in any unit measure, but same unit as duration)
float d = 300.0f; // Total time it should take to complete (duration)
@@ -180,8 +180,8 @@ int main(void)
// Movement computation
if (!paused && ((boundedT && t < d) || !boundedT))
{
- ballPosition.x = Easings[easingX].func(t, 100.0f, 700.0f - 100.0f, d);
- ballPosition.y = Easings[easingY].func(t, 100.0f, 400.0f - 100.0f, d);
+ ballPosition.x = Easings[easingX].func(t, 100.0f, 700.0f - 170.0f, d);
+ ballPosition.y = Easings[easingY].func(t, 100.0f, 400.0f - 170.0f, d);
t += 1.0f;
}
//----------------------------------------------------------------------------------
@@ -193,15 +193,15 @@ int main(void)
ClearBackground(RAYWHITE);
// Draw information text
- DrawText(TextFormat("Easing x: %s", Easings[easingX].name), 0, FONT_SIZE*2, FONT_SIZE, LIGHTGRAY);
- DrawText(TextFormat("Easing y: %s", Easings[easingY].name), 0, FONT_SIZE*3, FONT_SIZE, LIGHTGRAY);
- DrawText(TextFormat("t (%c) = %.2f d = %.2f", (boundedT == true)? 'b' : 'u', t, d), 0, FONT_SIZE*4, FONT_SIZE, LIGHTGRAY);
+ DrawText(TextFormat("Easing x: %s", Easings[easingX].name), 20, FONT_SIZE, FONT_SIZE, LIGHTGRAY);
+ DrawText(TextFormat("Easing y: %s", Easings[easingY].name), 20, FONT_SIZE*2, FONT_SIZE, LIGHTGRAY);
+ DrawText(TextFormat("t (%c) = %.2f d = %.2f", (boundedT == true)? 'b' : 'u', t, d), 20, FONT_SIZE*3, FONT_SIZE, LIGHTGRAY);
// Draw instructions text
- DrawText("Use ENTER to play or pause movement, use SPACE to restart", 0, GetScreenHeight() - FONT_SIZE*2, FONT_SIZE, LIGHTGRAY);
- DrawText("Use D and W or A and S keys to change duration", 0, GetScreenHeight() - FONT_SIZE*3, FONT_SIZE, LIGHTGRAY);
- DrawText("Use LEFT or RIGHT keys to choose easing for the x axis", 0, GetScreenHeight() - FONT_SIZE*4, FONT_SIZE, LIGHTGRAY);
- DrawText("Use UP or DOWN keys to choose easing for the y axis", 0, GetScreenHeight() - FONT_SIZE*5, FONT_SIZE, LIGHTGRAY);
+ DrawText("Use ENTER to play or pause movement, use SPACE to restart", 20, GetScreenHeight() - FONT_SIZE*2, FONT_SIZE, LIGHTGRAY);
+ DrawText("Use Q and W or A and S keys to change duration", 20, GetScreenHeight() - FONT_SIZE*3, FONT_SIZE, LIGHTGRAY);
+ DrawText("Use LEFT or RIGHT keys to choose easing for the x axis", 20, GetScreenHeight() - FONT_SIZE*4, FONT_SIZE, LIGHTGRAY);
+ DrawText("Use UP or DOWN keys to choose easing for the y axis", 20, GetScreenHeight() - FONT_SIZE*5, FONT_SIZE, LIGHTGRAY);
// Draw ball
DrawCircleV(ballPosition, 16.0f, MAROON);
@@ -226,4 +226,4 @@ static float NoEase(float t, float b, float c, float d)
d += burn;
return b;
-} \ No newline at end of file
+}
diff --git a/examples/others/easings_testbed.png b/examples/others/easings_testbed.png
index fb053853..05f63acd 100644
--- a/examples/others/easings_testbed.png
+++ b/examples/others/easings_testbed.png
Binary files differ