Skip to content

Instantly share code, notes, and snippets.

@hiiamboris
Last active March 16, 2021 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiiamboris/18037c696fe414f4721ce0641a2624a9 to your computer and use it in GitHub Desktop.
Save hiiamboris/18037c696fe414f4721ce0641a2624a9 to your computer and use it in GitHub Desktop.
Smooth rolling text
Red []
speed: 50
rt: rtd-layout [{ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.}]
rt/font: make font! [name: "Colonna MT" size: 100]
rt/size: 99999x999
rt/size: size-text rt
draw: compose/deep [scale 0.5 0.5 [pen cyan text 0x20 (rt)]]
draw2: compose/only/deep [translate 0x0 (draw) translate (rt/size * 1x0 / 2) (draw)]
t0: now/precise
system/view/auto-sync?: off
view/options/tight [
b: base purple with [size: system/view/screens/1/size * 1x0 + 0x100]
rate 100 on-time [
dt: difference now/precise t0
shift: dt/second * -2 * speed % rt/size/x
draw/4/4: shift * 1x0 + 0x20
b/draw: either (absolute shift) <= (rt/size/x - (b/size/x * 2)) [draw][draw2]
show b
]
][offset: 0x0 flags: 'no-border]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment