scrolling both directions now works
This commit is contained in:
@@ -79,13 +79,13 @@ void scrollAllScrollableTexts()
|
||||
{
|
||||
if (text_nodes[i].pos_y < 7)
|
||||
{
|
||||
shiftGivenRectangleLeft(text_nodes[i].pos_x, text_nodes[i].pos_y, text_nodes[i].characterSize.width * text_nodes[i].character_count + text_nodes[i].character_count - 1, text_nodes[i].characterSize.height, text_nodes[i].scroll_slowness);
|
||||
shiftGivenRectangleLeft(text_nodes[i].pos_x, text_nodes[i].pos_y, text_nodes[i].pos_x + text_nodes[i].characterSize.width * text_nodes[i].character_count + text_nodes[i].character_count - 1, text_nodes[i].pos_y + text_nodes[i].characterSize.height - 1, text_nodes[i].scroll_slowness);
|
||||
text_nodes[i].pos_x -= text_nodes[i].scroll_slowness;
|
||||
}
|
||||
else
|
||||
{
|
||||
shiftGivenRectangleRight(text_nodes[i].pos_x, text_nodes[i].pos_y, text_nodes[i].characterSize.width * text_nodes[i].character_count + text_nodes[i].character_count - 1 , text_nodes[i].pos_y + text_nodes[i].characterSize.height, text_nodes[i].scroll_slowness);
|
||||
text_nodes[i].pos_x += text_nodes[i].scroll_slowness;
|
||||
shiftGivenRectangleRight(text_nodes[i].pos_x, text_nodes[i].pos_y, text_nodes[i].pos_x + text_nodes[i].characterSize.width * text_nodes[i].character_count + text_nodes[i].character_count - 1, text_nodes[i].pos_y + text_nodes[i].characterSize.height - 1, text_nodes[i].scroll_slowness);
|
||||
text_nodes[i].pos_x += text_6nodes[i].scroll_slowness;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,8 +98,8 @@ void setup()
|
||||
pixels.begin();
|
||||
pixels.clear();
|
||||
|
||||
addNewTextNode("NET", 0xFF150000);
|
||||
addNewTextNode("FAILED", 0xFF150000, 0, 9);
|
||||
addNewTextNode("NET", 0xFF050505);
|
||||
addNewTextNode("AWAIT", 0xFF050505, 0, 9);
|
||||
drawTextNodes();
|
||||
|
||||
pixels.show();
|
||||
|
||||
Reference in New Issue
Block a user