Skip to main content

Module cinematic

Module cinematic 

Source
Expand description

Plays a cinematic (shuyi_assets::cinematic, ticket 1113; the game’s game ADR-0060): a Timeline says which shot a time falls in and how far through it, and a CinematicPlayer has the shot draw itself there. What a shot shows is the game’s: its shot kinds implement ShotPainter.

Every frame is drawn from the time alone: nothing is carried from one frame to the next, and no shot may keep state that an update advances; whatever moves in a shot is worked out from the time. So whoever owns the clock can follow the music, jump or loop, and a test can draw any moment. The player has no clock of its own.

The engine also gives what most shots move by: an ease_in_out (and every curve of shuyi_core::ease, through ease_f32), and a Pan over a picture shown as the frame’s backdrop (game ADR-0048, cinema::view), its frame (PanFrame) and its paint (paint_pan).

Structs§

CinematicPlayer
Draws a cinematic of shots S at any time.
Moment
Everything a shot is told about a moment of its cinematic.
Pan
A pan over a picture shown as the frame’s backdrop (game ADR-0048): the picture’s pixel from in the middle of the screen when the shot starts, to when it ends, eased in and out (ease_in_out), at one whole zoom for the whole shot.
PanFrame
A frame of a Pan: where its picture is behind the screen, as plain data.
ShotAt
Where a time falls in a Timeline.
Timeline
When each shot of a cinematic starts, and when the cinematic ends.

Traits§

ShotPainter
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.

Functions§

ease_in_out
p (0 to 1; clamped, not a number counts as 0) eased in and out: slow at both ends, fastest in the middle. It is smoothstep, the curve of Ease::Smooth, in f32; through ease_f32 a skin has every other curve too.
millis
t seconds in whole milliseconds. A time below 0, or one that isn’t a number, counts as 0.
paint_pan
Paints frame over the whole of buf: picture (a whole map, say: MapPicture) as its backdrop, behind cells that are all holes, in palette’s text color.