Fixes.
Prevent flickering if segment off.
This commit is contained in:
@@ -5878,20 +5878,21 @@ uint16_t mode_2Dscrollingtext(void) {
|
||||
else SEGENV.aux0 = (cols + (numberOfLetters * letterWidth))/2;
|
||||
++SEGENV.aux1 &= 0xFF; // color shift
|
||||
SEGENV.step = millis() + map(SEGMENT.speed, 0, 255, 10*FRAMETIME_FIXED, 2*FRAMETIME_FIXED);
|
||||
|
||||
// we need it 3 times
|
||||
SEGMENT.fade_out(255 - (SEGMENT.custom1>>5)); // fade to background color
|
||||
SEGMENT.fade_out(255 - (SEGMENT.custom1>>5)); // fade to background color
|
||||
SEGMENT.fade_out(255 - (SEGMENT.custom1>>5)); // fade to background color
|
||||
for (int i = 0; i < numberOfLetters; i++) {
|
||||
if (int(cols) - int(SEGENV.aux0) + letterWidth*(i+1) < 0) continue; // don't draw characters off-screen
|
||||
SEGMENT.drawCharacter(text[i], int(cols) - int(SEGENV.aux0) + letterWidth*i, yoffset, letterWidth, letterHeight, SEGMENT.color_from_palette(SEGENV.aux1, false, PALETTE_SOLID_WRAP, 0));
|
||||
if (!SEGMENT.check2) {
|
||||
// we need it 3 times
|
||||
SEGMENT.fade_out(255 - (SEGMENT.custom1>>5)); // fade to background color
|
||||
SEGMENT.fade_out(255 - (SEGMENT.custom1>>5)); // fade to background color
|
||||
SEGMENT.fade_out(255 - (SEGMENT.custom1>>5)); // fade to background color
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < numberOfLetters; i++) {
|
||||
if (int(cols) - int(SEGENV.aux0) + letterWidth*(i+1) < 0) continue; // don't draw characters off-screen
|
||||
SEGMENT.drawCharacter(text[i], int(cols) - int(SEGENV.aux0) + letterWidth*i, yoffset, letterWidth, letterHeight, SEGMENT.color_from_palette(SEGENV.aux1, false, PALETTE_SOLID_WRAP, 0));
|
||||
}
|
||||
|
||||
return FRAMETIME;
|
||||
}
|
||||
static const char _data_FX_MODE_2DSCROLLTEXT[] PROGMEM = "Scrolling Text@!,Y Offset,Trail,Font size;!,!;!;2;ix=128,c1=0,rev=0,mi=0,rY=0,mY=0";
|
||||
static const char _data_FX_MODE_2DSCROLLTEXT[] PROGMEM = "Scrolling Text@!,Y Offset,Trail,Font size,,,Overlay;!,!;!;2;ix=128,c1=0,rev=0,mi=0,rY=0,mY=0";
|
||||
|
||||
|
||||
////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user