pub trait ShotPainter {
type Game: GameData;
type Shared;
type Frame;
// Required methods
fn frame(
&self,
ctx: &Ctx<Self::Game>,
shared: &Self::Shared,
moment: Moment,
screen: Rect,
) -> Self::Frame;
fn paint(
&self,
ctx: &Ctx<Self::Game>,
shared: &Self::Shared,
moment: Moment,
frame: Self::Frame,
buf: &mut GlyphBuffer,
);
}Expand description
A game’s shot, built once to be drawn at any moment: one of its shot kinds with whatever it needs ready (a picture painted, a text laid out). Never changed by drawing.
Required Associated Types§
What every shot of a player is drawn with, from whoever plays it
(() for nothing): the backdrop a title picked, say.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".