SwiftUIKit / Marquee

A powerful implementation of Marquee(scrolling text or label) in SwiftUI, which supports any content view, including text(label), image, video, etc.
MIT License
72 stars 20 forks source link

Continuous text/ initial start position? #6

Open tigger04 opened 2 years ago

tigger04 commented 2 years ago

Love this plugin, it's exactly what I'm looking for. I've got 4 tickers stacked, I have the duration set to 20000 as I"m looking for a very very slow ticker.

Here's the problem, with it sliding in from the right, it takes about a minute to reach:

image

Of course, it's an extremely slow ticker. But I would like it to start from the position left aligned and slide from there, e.g.

image

also, when the text ends, you get a long blank period before the text repeats. Any way of reducing this gap to zero so that the text is continuous?

I'm happy to roll up my sleeves and have a go at updating the code if you can give me some pointers and I could submit a PR.

One other thing FYI I am occasionally getting some flickering and data cut off with long text - this one counts from item 1 to item 100:

image
stonko1994 commented 2 years ago

Hey @tigger04,

I basically added support for this in #4

The usage would look like this:

Marquee {
    Text(...)
}
.marqueeDelay(20_000)
.marqueeBoundary(.inner)