repeating texts
This commit is contained in:
@@ -40,8 +40,8 @@ short getTextNodeX2(TextNode *node)
|
||||
|
||||
void addNewTextNode
|
||||
(
|
||||
char text[TEXT_MAX_LENGTH + 1], uint32_t color, bool handle_pos_via_cursor = true, short pos_x = 0, short pos_y = 0,
|
||||
unsigned char scroll_slowness = 1, bool is_scrolling = true, bool is_small = true, short disappear_time = -1
|
||||
char text[TEXT_MAX_LENGTH + 1], uint32_t color, bool handle_pos_via_cursor, short pos_x, short pos_y,
|
||||
unsigned char scroll_slowness, bool is_scrolling, bool is_small, short disappear_time, bool is_repeating
|
||||
)
|
||||
{
|
||||
unsigned char text_length = strlen(text);
|
||||
@@ -69,6 +69,7 @@ void addNewTextNode
|
||||
text_nodes[i].character_count = text_length;
|
||||
text_nodes[i].scroll_slowness = scroll_slowness;
|
||||
text_nodes[i].is_scrolling = is_scrolling;
|
||||
text_nodes[i].is_repeating = is_repeating;
|
||||
text_nodes[i].disappear_time = disappear_time;
|
||||
ever_created_text_nodes++;
|
||||
|
||||
@@ -103,7 +104,14 @@ void scrollAllScrollableTexts(bool split_scroll_mode = false)
|
||||
{
|
||||
if (x2 < 0)
|
||||
{
|
||||
text_nodes[i].disappear_time = 1;
|
||||
if (text_nodes[i].is_repeating)
|
||||
{
|
||||
text_nodes[i].pos_x = DISPLAY_MAX_X;
|
||||
}
|
||||
else
|
||||
{
|
||||
text_nodes[i].disappear_time = 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
text_nodes[i].pos_x--;
|
||||
@@ -112,7 +120,14 @@ void scrollAllScrollableTexts(bool split_scroll_mode = false)
|
||||
{
|
||||
if (x1 > DISPLAY_MAX_X)
|
||||
{
|
||||
text_nodes[i].disappear_time = 1;
|
||||
if (text_nodes[i].is_repeating)
|
||||
{
|
||||
text_nodes[i].pos_x = -getTextNodeX2(&text_nodes[i]) + text_nodes[i].pos_x;
|
||||
}
|
||||
else
|
||||
{
|
||||
text_nodes[i].disappear_time = 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
text_nodes[i].pos_x++;
|
||||
@@ -137,8 +152,8 @@ void scrollAllScrollableTexts(bool split_scroll_mode = false)
|
||||
|
||||
void addNewMultiColor
|
||||
(
|
||||
char text[TEXT_MAX_LENGTH + 1], RGBWithIndex colors[4], unsigned char color_count, bool handle_pos_via_cursor = true, short pos_x = 0, short pos_y = 0,
|
||||
unsigned char scroll_slowness = 1, bool is_scrolling = true, bool is_small = true, short disappear_time = -1
|
||||
char text[TEXT_MAX_LENGTH + 1], RGBWithIndex colors[4], unsigned char color_count, bool handle_pos_via_cursor, short pos_x, short pos_y,
|
||||
unsigned char scroll_slowness, bool is_scrolling, bool is_small, short disappear_time, bool is_repeating
|
||||
)
|
||||
{
|
||||
unsigned char text_length = strlen(text);
|
||||
@@ -170,6 +185,7 @@ void addNewMultiColor
|
||||
multi_color_text_node[i].character_count = text_length;
|
||||
multi_color_text_node[i].scroll_slowness = scroll_slowness;
|
||||
multi_color_text_node[i].is_scrolling = is_scrolling;
|
||||
multi_color_text_node[i].is_repeating = is_repeating;
|
||||
multi_color_text_node[i].disappear_time = disappear_time;
|
||||
ever_created_multi_color_text_nodes++;
|
||||
|
||||
@@ -210,7 +226,14 @@ void scrollAllMultiColorTexts(bool split_scroll_mode = false)
|
||||
{
|
||||
if (x2 < 0)
|
||||
{
|
||||
multi_color_text_node[i].disappear_time = 1;
|
||||
if (multi_color_text_node[i].is_repeating)
|
||||
{
|
||||
multi_color_text_node[i].pos_x = DISPLAY_MAX_X;
|
||||
}
|
||||
else
|
||||
{
|
||||
multi_color_text_node[i].disappear_time = 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
multi_color_text_node[i].pos_x--;
|
||||
@@ -219,7 +242,14 @@ void scrollAllMultiColorTexts(bool split_scroll_mode = false)
|
||||
{
|
||||
if (x1 > DISPLAY_MAX_X)
|
||||
{
|
||||
multi_color_text_node[i].disappear_time = 1;
|
||||
if (multi_color_text_node[i].is_repeating)
|
||||
{
|
||||
multi_color_text_node[i].pos_x = -getMultiColorTextNodeX2(&multi_color_text_node[i]) + multi_color_text_node[i].pos_x;
|
||||
}
|
||||
else
|
||||
{
|
||||
multi_color_text_node[i].disappear_time = 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
multi_color_text_node[i].pos_x++;
|
||||
|
||||
Reference in New Issue
Block a user