Skip to main content

BackgroundPattern

Trait BackgroundPattern 

Source
pub trait BackgroundPattern {
    // Required method
    fn paint(&self, surface: &mut Surface<'_>);
}
Expand description

One-shot painter for a motion background.

Implementations populate a Surface with a static pattern. The surface is a view over the head half of a crate::motion::JumboBuffer; the crawl engine copies the head into the tail after the pattern has been painted so scrolling can wrap seamlessly.

Required Methods§

Source

fn paint(&self, surface: &mut Surface<'_>)

Paint this pattern into surface.

The function is called once at crawl activation time, not every frame. Implementations may therefore be slow (CPU plot, loops, etc.) without impacting runtime frame rate.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§