Centered text

This commit is contained in:
2020-09-14 14:14:10 -04:00
parent cb7fdcf50b
commit bbe0dd00f0
5 changed files with 54 additions and 4 deletions

View File

@ -28,5 +28,17 @@ void NoiseDroplet::Process(float** in, float** out, size_t size) {
}
void NoiseDroplet::Draw() {
WriteString(*patch, 0, 30, Font_6x8, "Test");
DrawName(patch);
}
void NoiseDroplet::DrawName(DaisyPatch* patch) {
int min = 0;
int max = SSD1309_WIDTH;
if (state == DropletState::kLeft) {
max = SSD1309_WIDTH / 2;
} else if (state == DropletState::kRight) {
min = SSD1309_WIDTH / 2;
}
WriteCenteredString(*patch, (min + max) / 2, 0, Font_6x8, "Noise");
}

View File

@ -14,6 +14,7 @@ class NoiseDroplet: public Droplet {
DaisyPatch* patch;
daisysp::WhiteNoise noise;
daisysp::NlFilt filter;
void DrawName(DaisyPatch*);
public:
NoiseDroplet(DaisyPatch*, float, DropletState);
void Control();