pub struct CinematicPlayer<S> { /* private fields */ }Expand description
Draws a cinematic of shots S at any time.
Implementations§
Source§impl<S> CinematicPlayer<S>
impl<S> CinematicPlayer<S>
Sourcepub fn new(timeline: Timeline, shots: Vec<S>) -> Self
pub fn new(timeline: Timeline, shots: Vec<S>) -> Self
A player of shots (one for each start of timeline).
Sourcepub fn of<'d, D>(
def: &'d CinematicDef<D>,
build: impl FnMut(&'d D) -> S,
) -> Self
pub fn of<'d, D>( def: &'d CinematicDef<D>, build: impl FnMut(&'d D) -> S, ) -> Self
A player of the cinematic def, each shot built once by build,
in order.
Source§impl<S: ShotPainter> CinematicPlayer<S>
impl<S: ShotPainter> CinematicPlayer<S>
Sourcepub fn frame(
&self,
ctx: &Ctx<S::Game>,
shared: &S::Shared,
t: f32,
screen: Rect,
) -> Option<S::Frame>
pub fn frame( &self, ctx: &Ctx<S::Game>, shared: &S::Shared, t: f32, screen: Rect, ) -> Option<S::Frame>
What is shown t seconds after the start (wrapped at the length),
on a screen of screen cells; None with no shots.
Sourcepub fn draw(
&self,
ctx: &Ctx<S::Game>,
shared: &S::Shared,
t: f32,
brightness: f32,
buf: &mut GlyphBuffer,
)
pub fn draw( &self, ctx: &Ctx<S::Game>, shared: &S::Shared, t: f32, brightness: f32, buf: &mut GlyphBuffer, )
Draws the cinematic as it is t seconds after its start (wrapped
at the length) over the whole of buf, at brightness (1 = as it
is, 0 = black: GlyphBuffer::fade). The same t always draws
the same frame.
Trait Implementations§
Source§impl<S: Clone> Clone for CinematicPlayer<S>
impl<S: Clone> Clone for CinematicPlayer<S>
Source§fn clone(&self) -> CinematicPlayer<S>
fn clone(&self) -> CinematicPlayer<S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S: Debug> Debug for CinematicPlayer<S>
impl<S: Debug> Debug for CinematicPlayer<S>
Source§impl<S: PartialEq> PartialEq for CinematicPlayer<S>
impl<S: PartialEq> PartialEq for CinematicPlayer<S>
impl<S: PartialEq> StructuralPartialEq for CinematicPlayer<S>
Auto Trait Implementations§
impl<S> Freeze for CinematicPlayer<S>
impl<S> RefUnwindSafe for CinematicPlayer<S>where
S: RefUnwindSafe,
impl<S> Send for CinematicPlayer<S>where
S: Send,
impl<S> Sync for CinematicPlayer<S>where
S: Sync,
impl<S> Unpin for CinematicPlayer<S>where
S: Unpin,
impl<S> UnsafeUnpin for CinematicPlayer<S>
impl<S> UnwindSafe for CinematicPlayer<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more