Weiter Logic Fehler changed.
This commit is contained in:
parent
00127d17f9
commit
c58f4a6af8
|
@ -73,22 +73,27 @@ void TextRenderer::update(std::string newText) {
|
||||||
if(newText[i] == specialCharacter) {
|
if(newText[i] == specialCharacter) {
|
||||||
space -= 1;
|
space -= 1;
|
||||||
|
|
||||||
currentX = ((i + space) % fontNumbersInOneLine) * (fontWidth + left_margin);
|
int tempBlinkX = blinkX;
|
||||||
currentY = ((i + space) / fontNumbersInOneLine) * (fontHeight + bottom_margin);
|
int tempBlinkY = blinkY;
|
||||||
|
int tempSpecialCharacterCurrentX = specialCharacterCurrentX;
|
||||||
|
int tempSpecialCharacterCurrentY = specialCharacterCurrentY;
|
||||||
|
char tempSpecialChar = _specialCharacter;
|
||||||
|
|
||||||
|
specialCharacterCurrentX = ((i + space) % fontNumbersInOneLine) * (fontWidth + left_margin);
|
||||||
|
specialCharacterCurrentY = ((i + space) / fontNumbersInOneLine) * (fontHeight + bottom_margin);
|
||||||
|
|
||||||
// blink.setCurrentX(currentX + fontWidth);
|
// blink.setCurrentX(currentX + fontWidth);
|
||||||
// blink.setCurrentY(currentY);
|
// blink.setCurrentY(currentY);
|
||||||
int tempBlinkX = blinkX;
|
|
||||||
int tempBlinkY = blinkY;
|
|
||||||
|
|
||||||
blinkX = currentX + fontWidth;
|
blinkX = specialCharacterCurrentX + fontWidth;
|
||||||
blinkY = currentY;
|
blinkY = specialCharacterCurrentY;
|
||||||
|
_specialCharacter = newText[i - 1];
|
||||||
|
|
||||||
|
characterBitmap = getCharacter(_specialCharacter, font);
|
||||||
|
translateToSharedMemory(characterBitmap, specialCharacterCurrentX, specialCharacterCurrentY, speicialFontColor);
|
||||||
|
|
||||||
clear(tempBlinkX, tempBlinkY, tempBlinkX + 1, tempBlinkY + fontHeight);
|
clear(tempBlinkX, tempBlinkY, tempBlinkX + 1, tempBlinkY + fontHeight);
|
||||||
|
translateToSharedMemory(getCharacter(tempSpecialChar), tempSpecialCharacterCurrentX, tempSpecialCharacterCurrentY, fontColor);
|
||||||
characterBitmap = getCharacter(newText[i - 1], font);
|
|
||||||
|
|
||||||
translateToSharedMemory(characterBitmap, currentX, currentY, speicialFontColor);
|
|
||||||
} else {
|
} else {
|
||||||
currentLine = ((i + space) / fontNumbersInOneLine);
|
currentLine = ((i + space) / fontNumbersInOneLine);
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,9 @@ private:
|
||||||
Font font;
|
Font font;
|
||||||
char returnCharacter = '\n';
|
char returnCharacter = '\n';
|
||||||
char specialCharacter = -127;
|
char specialCharacter = -127;
|
||||||
|
int specialCharacterCurrentX;
|
||||||
|
int specialCharacterCurrentY;
|
||||||
|
char _specialCharacter;
|
||||||
int fontSize = 1;
|
int fontSize = 1;
|
||||||
int left_margin = 1;
|
int left_margin = 1;
|
||||||
int bottom_margin = 1;
|
int bottom_margin = 1;
|
||||||
|
|
Loading…
Reference in New Issue