Command
video
video
Syntax
video play "cutscene.mp4";
video play "cutscene.mp4" loop true;
video play "cutscene.mp4" fit contain;
video play "cutscene.mp4" loop false fit cover;
video stop;
wait video;
Description Plays a video layer behind sprites and UI.
loop:trueorfalse(defaultfalse)fit:contain: keep full frame visible (letterbox if needed)cover: fill screen (crop if needed)stretch: stretch to screen
video stop; stops playback and removes the video layer.
wait video; blocks script advance until video playback (and queued video-audio) ends.
Notes
- Video files resolve from
assets.videoinproject.json(defaultassets/video). - Backend selection comes from
project.jsonkeyvideo_backend:auto(default): usevnefvnef: force nativevnef-videoimageio: legacy alias (maps tovnef)
- Embedded video audio can be toggled with
project.jsonkeyvideo_audio(defaulttrue). - Frame drop policy uses
project.jsonkeyvideo_framedrop:auto: adaptive mode (toggles on/off based on real-time lag/queue)on: always drop late framesoff: never drop (can visually lag on weak hardware)
vnefbackend requiresvnef-videonative library.
Build Requirement
- Engine dev / CI building the native video library: needs CMake toolchain.
- Game creators and players: do not need CMake if shipped with prebuilt
libvnef_videofor their platform. - Optional override for custom library path:
CPYVN_VNEF_VIDEO_LIB=/absolute/path/to/libvnef_video.so(Linux example)CPYVN_VNEF_VIDEO_DIR=/path/to/folder/containing/lib(engine searches this dir too)
- Export flow (engine + game) is documented in
docs/export.md.
Example
label intro_cutscene:
video play "opening.mp4" loop false fit contain;
wait video;
go start;