[][src]Trait rmicrobit::graphics::scrolling::Scrollable

pub trait Scrollable {
    type Subimage: Render;
    fn length(&self) -> usize;
fn state(&self) -> &ScrollingState;
fn state_mut(&mut self) -> &mut ScrollingState;
fn subimage(&self, index: usize) -> &Self::Subimage; fn current_brightness_at(&self, x: usize, y: usize) -> u8 { ... } }

A horizontally scrolling sequence of 5×5 images.

Scrollables automatically implement Animate.

When a Scrollable also implements Render, the rendered image is the current state of the animation.

Associated Types

type Subimage: Render

The type of the underlying 5×5 images.

Loading content...

Required methods

fn length(&self) -> usize

The number of underlying images.

fn state(&self) -> &ScrollingState

A ScrollingState indicating the current point in the animation.

fn state_mut(&mut self) -> &mut ScrollingState

A ScrollingState indicating the current point in the animation, as a mutable reference.

fn subimage(&self, index: usize) -> &Self::Subimage

A reference to the underlying image at the specified index.

Loading content...

Provided methods

fn current_brightness_at(&self, x: usize, y: usize) -> u8

Returns the brightness value for a single LED in the current state.

Use this to implement Render.

Loading content...

Implementors

impl Scrollable for ScrollingBufferedText[src]

type Subimage = BitImage

impl Scrollable for ScrollingStaticText[src]

type Subimage = BitImage

impl<T: Render + 'static> Scrollable for ScrollingImages<T>[src]

type Subimage = T

Loading content...