v1.2.0.1-beta1
|
Scrolls long text horizontally with only a portion visible at one time.
This script's main function, marquee()
, takes a line of text as input and updates a Touch Portal State with a portion of that text visible (up to a specified maximum length), pauses for some time, then sends the next set of characters that should be visible. This creates a scrolling animation like a marquee.
marquee()
takes some optional parameters to specify how quickly the text should scroll, how long to delay before starting, or re-starting, the scroll, and whether to restart the scroll after showing the full text once. See comments in the script itself for more details.
In an actual button/flow you would most likely put the action inside an event handler which reacts to a change in a State/Value you would like to display, and put that State/Value's macro inside the quotes of the marquee()
call, instead of my static example. Eg.
marquee("${value:com.github.ChristopheCVB.TouchPortal.Spotify.TouchPortalSpotifyPlugin.BaseCategory.state.currentTrackName}")
The script also has a function to cancel/stop the scroll animation on demand. Here is an example of a button for that.
The key point is that it uses the same State Name as the action which started the marquee to begin with (and also runs in a Private instance).