168 {
169
170
171 uint32_t total =
173
174
175
177
178
179 if (button_active) {
180 pointTransition.
trigger(now, total, 0, 0);
181 }
182
183
184 if (!pointTransition.
isActive(now)) {
185
186 return;
187 }
188
189
190 int mid_x =
WIDTH / 2;
192
193
194 int amount =
WIDTH / 2;
195
196
197 int start_x = mid_x - amount;
198 int end_x = mid_x + amount;
199 int start_y = mid_y - amount;
200 int end_y = mid_y + amount;
201
202
203 int curr_alpha = pointTransition.
update8(now);
204
205
206
207 int left_x =
map(curr_alpha, 0, 255, mid_x, start_x);
208 int down_y =
map(curr_alpha, 0, 255, mid_y, start_y);
209 int right_x =
map(curr_alpha, 0, 255, mid_x, end_x);
210 int up_y =
map(curr_alpha, 0, 255, mid_y, end_y);
211
212
213 float curr_alpha_f = curr_alpha / 255.0f;
214
215
216
217 float valuef = (1.0f - curr_alpha_f) *
fancyIntensity.value() / 255.0f;
218
219
221
222
223
224
225
226 for (
int x = left_x - span;
x < left_x + span;
x++) {
229 }
230
231
232 for (
int x = right_x - span;
x < right_x + span;
x++) {
235 }
236
237
238 for (
int y = down_y - span;
y < down_y + span;
y++) {
241 }
242
243
244 for (
int y = up_y - span;
y < up_y + span;
y++) {
247 }
248}
uint8_t update8(uint32_t now) override
Compute current 0–255 output based on how much time has elapsed since trigger().
bool isActive(uint32_t now) const override
void trigger(uint32_t now) override
Call this when you want to (re)start the ramp cycle.
long map(long x, long in_min, long in_max, long out_min, long out_max)
UISlider fancyParticleSpan("Fancy Particle Span", 0.06f, 0.01f, 0.2f, 0.01f)
WaveFx waveFxLower(xyRect, CreateArgsLower())
UISlider fancySpeed("Fancy Speed", 796, 0, 1000, 1)
UISlider fancyIntensity("Fancy Intensity", 32, 1, 255, 1)
WaveFx waveFxUpper(xyRect, CreateArgsUpper())