forked from diodeface/ToasterBlaster
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverlays.cpp
More file actions
80 lines (73 loc) · 2.9 KB
/
Overlays.cpp
File metadata and controls
80 lines (73 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include "Overlays.h"
/**
* Declare your overlays here. Read OverlaySequence.h for more info.
*
* Remember to set interruptable boolean on tweens to false to make sure they
* don't get cleared on a sequence or controller change.
*/
using namespace Config::Displays;
namespace Overlays {
// Boop ----------------------------------
Effect* boopEffects[5] {
new DrawBitmap(EYES, Bitmaps::Eye::boop, 16),
new DrawBitmap(MOUTH_L, Bitmaps::Mouth::happy, 32),
new DrawBitmap(MOUTH_R, Bitmaps::Mouth::happy, 32),
new DrawBitmap(NOSE, Bitmaps::Nose::neutral, 8),
new Mirror(LEFT_SIDE)
};
#define BOOP_EFFECTS boopEffects[0], boopEffects[1], boopEffects[2], boopEffects[3], boopEffects[4]
Glitch* boopGlitch = new Glitch(ALL, 0, 4);
OverlaySequence boop {
{
{
{
new Tween<u8>(&(boopGlitch->intensity), 100, 0, 750 MILLIS, TWEEN_LINEAR, false),
new Tween<u8>(&(boopGlitch->maxShift), 8, 1, 750 MILLIS, TWEEN_LINEAR, false),
BOOP_EFFECTS,
boopGlitch
}, 750 MILLIS
},
{{BOOP_EFFECTS}, UINT_MAX, -2}
}
};
// ---------------------------------------
// EyeBlink class related overlays
namespace EyeBlink {
Blink* blinkEyes = new Blink(EYES, 0);
Translate* translateEyes = new Translate(EYES, 0, 0);
Expand* expandEyes = new Expand(EYES, 0);
OverlaySequence closing {
{
{
{
new Tween<u8>(&(blinkEyes->amount), 0, 5, 100 MILLIS, TWEEN_LINEAR, false),
new Tween<i8>(&(translateEyes->y), 0, 3, 100 MILLIS, TWEEN_LINEAR, false),
new Tween<u8>(&(expandEyes->iterations), 0, 3, 100 MILLIS, TWEEN_LINEAR, false),
translateEyes, expandEyes, blinkEyes
}, 100 MILLIS
},
{{translateEyes, expandEyes, blinkEyes}, 0, 0} // todo: fix bug in overlayplayer where the last keyframe is only displayed once before stopping requiring dirty hacks like this :)
}
};
OverlaySequence closed {
{
{
{new Clear(EYES)}, UINT_MAX, -2
}
}
};
OverlaySequence opening {
{
{
{
new Tween<u8>(&(blinkEyes->amount), 5, 0, 100 MILLIS, TWEEN_LINEAR, false),
new Tween<i8>(&(translateEyes->y), 3, 0, 100 MILLIS, TWEEN_LINEAR, false),
new Tween<u8>(&(expandEyes->iterations), 3, 0, 100 MILLIS, TWEEN_LINEAR, false),
translateEyes, expandEyes, blinkEyes
}, 100 MILLIS
},
END_SEQUENCE
}
};
}
}