rain
¶
The digital rain Reloaded plays as it closes.
Every drop spells the word, so a trail reads "mujoco-mojo" from the bottom up, each column starting at a different letter. The head is the bright bottom end, so the start of the word is what shows brightest and the end is what fades. It is kept calm on purpose. A letter is set once, when a drop reaches it, and then holds still as the trail fades, and the trail fades from the accent color into the background. A fresh random glyph in every cell on every frame is what makes rain look blotchy.
WORD
module-attribute
¶
WORD: str = 'mujoco-mojo'
What the drops spell, read from the bottom of a trail up, over and over.
-
Reference
mujoco_mojoutilslayersreloadedrainTRAIL_LENGTH
WORD_GAP
module-attribute
¶
WORD_GAP: int = 4
Blank cells between one reading of the word and the next. 0 runs them together.
COLUMN_SPACING
module-attribute
¶
COLUMN_SPACING: int = 2
Only every this many columns carries a drop, so 2 leaves a blank column between drops.
TRAIL_LENGTH
module-attribute
¶
The shortest and longest trail a drop can have.
RESTART_WITHIN
module-attribute
¶
RESTART_WITHIN: float = 1 / 3
A drop that has left the screen starts again within this fraction of the screen height above it, which sets how closely one follows another.
Drop
dataclass
¶
Rain
dataclass
¶
The falling letters as plain data, so the animation can be checked without a screen.
drops
class-attribute
instance-attribute
¶
The drop in each column that has one.
letters
class-attribute
instance-attribute
¶
The letter at each row and column, fixed until a drop's head next reaches that cell. A cell no drop has reached holds a space.
step
¶
Moves every drop down, setting the letter of the text where a head arrives and sending a drop that has left the screen back above it.
Source code in src/mujoco_mojo/utils/layers/reloaded/rain.py
trail
¶
How far behind its drop's head the cell is and how long that drop's trail is, or None for an empty cell. A head is 0 behind.
Source code in src/mujoco_mojo/utils/layers/reloaded/rain.py
letter_at
¶
The letter a head sets on row. The text reads from the bottom up, so each row down is one letter back.