13 hours ago · Tech · 0 comments

Based on a thing I did yesterday, I have an idea that I think will be quite nice. BorderedText, good yesterday and gratuitously better today. The plain white text for the Scroller doesn’t have very good contrast: Arcade and pyglet don’t offer a Text with a different stroke from fill color, but there’s a suggested trick where you draw the text five times, four times offset in one color, then once centered in the contrasting color. Yesterday afternoon I did that, and the result is quite nice: I addressed the problem yesterday while you were away. Let’s take a look at how I did it then. The overview is this: During announce: Upon receiving the announce message that gives Scroller a text line to display, Scroller creates an Arcade.Text item, doing the conversion to text just once per announce, storing the Text item in its buffer. Scroller also calculates the center X value at that time. During draw: Scroller iterates over as many lines as it is expected to display. It fetches each line,…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.