Skip to main content

Module video

Module video 

Source
Expand description

Videos (docs/design/video.md): a client plays a mod’s .yvideo (resources/video/intro.yvideo is mymod:intro) on anything drawn with a picture — a screen, a quad in the world, an entity’s or a model’s texture. Its frame is decoded when it’s asked for, each frame it’s drawn. Nothing plays on a dedicated server.

ⓘ
use yog_api::video::Player;
let intro = Player::open("mymod:intro").expect("the mod's video");
intro.play();
// each frame it's drawn:
if let Some(p) = intro.frame() {
    gfx.draw2d().image(&p.texture, rect);
}

Structs§

Picture
A player’s picture and where it is.
Player
A player of one video, paused at its start when opened; closed when dropped.

Functions§

cutscene
Plays video id full screen over the game till its end (a cutscene); skippable: Esc ends it early. Whether it started.