mirror of
				https://github.com/AquaMorph/Droplets.git
				synced 2025-10-31 16:23:19 +00:00 
			
		
		
		
	Centered text
This commit is contained in:
		| @@ -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"); | ||||
| } | ||||
|   | ||||
| @@ -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(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user