Last active
March 16, 2021 08:48
-
-
Save hiiamboris/18037c696fe414f4721ce0641a2624a9 to your computer and use it in GitHub Desktop.
Smooth rolling text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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