pub struct Title {
pub phenomenon: &'static str,
pub mechanism: &'static str,
}Expand description
A scene’s live title: Meta.title split at SEPARATOR, with the mechanism replaced
by the live caption when there is one (CORE-R71).
Fields§
§phenomenon: &'static str§mechanism: &'static strEmpty when the title has no separator and there is no caption.
Implementations§
Source§impl Title
impl Title
pub fn new(title: &'static str, caption: Option<&'static str>) -> Self
Sourcepub fn of(g: &(impl Generator + ?Sized)) -> Self
pub fn of(g: &(impl Generator + ?Sized)) -> Self
The live title of g: its Meta.title with its current caption (CORE-R71).
Sourcepub fn chars(&self, form: Form) -> impl Iterator<Item = char> + use<>
pub fn chars(&self, form: Form) -> impl Iterator<Item = char> + use<>
The chars of form in reading order, for callers that write it themselves
(the HUD maps them through ascii_of).
Sourcepub fn fit(&self, size: Size) -> Option<Form>
pub fn fit(&self, size: Size) -> Option<Form>
The longest form that fits a canvas of size, or None (CORE-R73). A form fits
when it plus its gutter and pad cells take at most 3/5 of the width, so the title
never dominates the art; forms are shown whole, never clipped.
Sourcepub fn full_fits_from(&self) -> usize
pub fn full_fits_from(&self) -> usize
The narrowest canvas width from which fit always picks
Form::Full (at a tall enough height): ⌊3w/5⌋ ≥ n ⇔ w ≥ ⌈5n/3⌉, with n the
full form plus its two pad cells (CORE-R73).