pattern effect automatic up,down,left, right #230
Unanswered
djravi
asked this question in
Задавайте вопросы
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
uint8_t effectBrightness = getBrightnessCalculated(globalBrightness, getEffectContrastValue(thisMode));
uint8_t variant = map8(getEffectScaleParamValue(MC_PATTERNS),0,4);
uint8_t spd1 = map8(255-getEffectSpeedValue(MC_PATTERNS), 6, 15);
uint8_t spd2 = map8(255-getEffectSpeedValue(MC_PATTERNS), 7, 20);
switch(variant) {
case 1:
// снизу вверх
columnIdx = -((pWIDTH % W) / 2) + 1;
lineIdx++;
if (lineIdx >= H) lineIdx = 0;
y_offs = lineIdx;
x_offs = columnIdx;
break;
case 2:
// сверху вниз
columnIdx = -((pWIDTH % W) / 2) + 1;
lineIdx--;
if (lineIdx < 0) lineIdx = H - 1;
y_offs = lineIdx;
x_offs = columnIdx;
break;
case 3:
// справа налево
lineIdx = 0;
columnIdx++;
if (columnIdx >= W) columnIdx = 0;
y_offs = lineIdx;
x_offs = columnIdx;
break;
case 4:
// слева направо
lineIdx = 0;
columnIdx--;
if (columnIdx < 0) columnIdx = W - 1;
y_offs = lineIdx;
x_offs = columnIdx;
break;
default:
// Переменное движение
y_offs = beatsin8(spd1, 1, 32); // for X and Y texture move
x_offs = beatsin8(spd2, 1, 32); // for X and Y texture move
break;
}
I want pattern effects automatically change left, right, up, down
pattern.txt
Beta Was this translation helpful? Give feedback.
All reactions