Skip to main content

Module spinner

Module spinner 

Source
Expand description

The one mark that says something is under way: a faint ring with a quarter of it in full colour, turning, where there are pictures, and turning braille on cells. Anything places it on the grid (Grid::spinner), in the colour of what it means. Every spinner on a grid stands at the same step, which the grid is given (Grid::turn), so one clock turns them all and a turn is a cycle of ten pictures: once a row’s ten tiles are in the terminal, turning sends nothing but placements.

With motion off a spinner is a still dot in its colour, and asks for no frames.

Constants§

FRAMES
The cell tier’s frames, one a step.
STEP
How long a step lasts: a turn in 0.9 s.
STEPS
Steps in one turn: the braille frames, and as many places for the ring’s arc.
STILL
What stands for a spinner on cells with motion off, and for a state’s dot: a still dot.

Functions§

clock
The clock every spinner turns by: time since it was first read. A test gives its grid a step of its own instead.
inked
How much of a pixel at (u, v) in the spinner’s square box is inked, as (the ring, the arc), each 0 to 1: the ring is drawn at a quarter of the colour’s strength and the arc over it at full. The box is 24 units across, as an icon’s, the ring 9 from the middle with a stroke of 3.2, and the arc a quarter of it with round ends, starting at the top and going round a tenth of a turn a step. None is the still dot: a disc half the box across.
step_at
The step a spinner stands at, at a time on that clock.
until_next
How long from a time on that clock until the next step begins: when a grid with something turning on it wants drawing again.