Marquee Pauses

The marquee in my app pauses for a moment when the character length is shorter. I’m pulling my hair out trying to get this to scroll smoothly no matter the length. Any ideas?

njt_bus

I use this function to create each of the 2 rows above. This function is used twice and then wrapped in Column.

def bus_row(line, headsign, next_times):
    return render.Row(
                    children = [
                        render.Box(
                            color = LINE_BACKGROUND_COLOR,
                            width = 19,
                            height = 13,
                            child = render.Row(
                                children = [
                                    render.Box(
                                        width = 1,
                                    ),
                                    render.Text(content = line, font = "6x13"),
                                ],
                            ),
                        ),
                        render.Box(
                            width = 1,
                            height = 14,
                        ),
                        render.Column(
                            main_align = "start",
                            cross_align = "left",
                            children = [
                                render.Text(headsign, font = 'tom-thumb'),
                                render.Marquee(
                                    width = 46,
                                    child = render.Text(next_times, font = "tb-8", color = "#FFD580")
                                )
                            ],
                        ),
                    ],
                )

Maybe try experimenting with the offset_start and offset_end properties of the Marquee?

You can get the width of the Text widgets with a code like this:

txt1 = render.Text("A short text")
txt2 = render.Text("A very very long text")

# .size() gives you a tuple with (width, height)
width1 = txt1.size()[0]
width2 = txt2.size()[0]
diff = abs(width1 - width2)

I’m not sure if you can really solve this “problem” or if it’s a given nature of the Marquee widget and how Tidbyt animates things. :confused:

The Marquee widget itself only scrolls through the text once, and then comes to a stop at the beginning of the text. It remains stopped until all other animations are complete, at which point your app’s timeline is over - and the entire thing repeats from the beginning.

If you want a continuous marquee, you may need to animate the text yourself.