summaryrefslogtreecommitdiffhomepage
path: root/src/easings.h
diff options
context:
space:
mode:
authorJoshua Reisenauer <[email protected]>2016-05-03 02:52:45 -0700
committerJoshua Reisenauer <[email protected]>2016-05-03 02:52:45 -0700
commitd6feeb14ffc11e54a82f51dbbe899f720d6997e8 (patch)
tree4c297f995075bd6e1465f85da9001c6d701006ab /src/easings.h
parent9d09ada33b26704a7f5d285d2f0d115e41df41bf (diff)
downloadraylib-d6feeb14ffc11e54a82f51dbbe899f720d6997e8.tar.gz
raylib-d6feeb14ffc11e54a82f51dbbe899f720d6997e8.zip
pause on no data
Diffstat (limited to 'src/easings.h')
-rw-r--r--src/easings.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/easings.h b/src/easings.h
index a198be4d..e1e5465a 100644
--- a/src/easings.h
+++ b/src/easings.h
@@ -7,6 +7,23 @@
* This header uses:
* #define EASINGS_STATIC_INLINE // Inlines all functions code, so it runs faster.
* // This requires lots of memory on system.
+* How to use:
+* The four inputs t,b,c,d are defined as follows:
+* t = current time in milliseconds
+* b = starting position in only one dimension [X || Y || Z] your choice
+* c = the total change in value of b that needs to occur
+* d = total time it should take to complete
+*
+* Example:
+* float speed = 1.f;
+* float currentTime = 0.f;
+* float currentPos[2] = {0,0};
+* float newPos[2] = {1,1};
+* float tempPosition[2] = currentPos;//x,y positions
+* while(currentPos[0] < newPos[0])
+* currentPos[0] = EaseSineIn(currentTime, tempPosition[0], tempPosition[0]-newPos[0], speed);
+* currentPos[1] = EaseSineIn(currentTime, tempPosition[1], tempPosition[1]-newPos[0], speed);
+* currentTime += diffTime();
*
* A port of Robert Penner's easing equations to C (http://robertpenner.com/easing/)
*