Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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