diff options
Diffstat (limited to 'src/include/ui/animation.h')
| -rw-r--r-- | src/include/ui/animation.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/include/ui/animation.h b/src/include/ui/animation.h new file mode 100644 index 0000000..1a10c0f --- /dev/null +++ b/src/include/ui/animation.h @@ -0,0 +1,24 @@ +/*
+* BSD 2-Clause “Simplified” License
+* Copyright (c) 2019, Aldrik Ramaekers, aldrik.ramaekers@protonmail.com
+* All rights reserved.
+*/
+
+#ifndef INCLUDE_ANIMATION
+#define INCLUDE_ANIMATION
+
+typedef struct t_animation
+{
+ float time;
+ bool started;
+ float duration;
+ float percentage;
+} animation;
+
+#define AN_LI(_cx,_dx,_an) (_cx + (_dx-_cx)*_an.percentage)
+#define AN_LI_TINT(_color, _an) rgba((_color).r,(_color).g,(_color).b,255*_an.percentage)
+
+animation animation_create(s32 duration);
+float animation_update(animation* an);
+
+#endif
\ No newline at end of file |
