Skip to content

TextEffect

Source: TextEffect.h

TextEffect

class TextEffect
src/light/effects/TextEffect.h:18

Inherits: EffectBase

Effect rendering a scrolling multi-line string in a bitmap font.

TextEffect card TextEffect controls

The text is static by default, laid out from the top left and clipped at the grid's edge. scroll marches the whole block leftward as a marquee instead, wrapping as it goes. Each newline drops a row, so several lines render at once.

Prior art: MoonLight's Scrolling Text, whose font set and scroll this carries.

Public Attributes

char text_ = "MoonLight" : The string to show, where the text area preserves its newlines.

bool scroll = false : March the block leftward as a marquee rather than holding it still.

uint8_t font = 1 : Which bitmap font renders it.

uint8_t speed = 30 : How fast the marquee runs, when scrolling.

uint8_t hue = 128 : The palette index the text takes, mid-palette since some palettes start black.

Public Methods

virtual inline const char * tags() const override : Catalog tags: MoonLight origin.

virtual inline Dim dimensions() const override : Draws on the z=0 plane, which extrude fills through a volume.

virtual inline void defineControls() override : Publish the string, the scroll, the font and the color.

virtual inline void tick() override : Draw the text, either in place or marched along its marquee cycle.