class

Phosphor::NoTransition(S, M)

Inherits Phosphor::Transition < Reference < Object

The default Transition — an empty iterator, so Cmd::Push/Cmd::Pop/ Cmd::Replace swap screens instantly with zero overhead, exactly as they did before Transition existed. App#run falls back to this when no Transition is configured.

Instance methods

frames(from : Screen(S, M), to : Screen(S, M), state : S) : Iterator(Proc(Buffer, Void))

Returns an iterator of compositing Procs, one per animation frame, for a transition from from to to, rendering with state.

Each yielded Proc(Buffer, Void) receives the frame's shared Buffer and paints the in-progress transition state into it — Procs rather than raw Frames, since a transition needs to blend from's and to's own renders (e.g. a slide needs both screens' content in the same buffer, offset against each other), which this lets a concrete Transition do without needing Buffer's constructor exposed publicly.

state is passed through to Screen#render for both from and toAppState is shared across the screen stack (see Phase 19), so a single value renders either screen correctly. Neither from nor to caches its own state, so a Transition can't render them without it.

App#run consumes this iterator one Proc per render tick during a transition; once it's exhausted, to becomes the fully active screen. An iterator with no elements (see NoTransition) means the swap happens on the very next render, with no animation at all.

Source