Skip to content

Background features

K4thos edited this page Sep 27, 2025 · 19 revisions

Video Background Element (nightly build only)

Ikemen GO adds a fourth background element type that plays a video as part of the background definition. It follows the same [BG ...] block format as other elements and participates in draw order exactly like them.

Media support

  • Containers: WebM (.webm), Matroska (.mkv)
  • Video codecs: VP8, VP9
  • Audio codecs: Opus, Vorbis

Audio plays if present in the media.

Coordinate system & base pivot

  • Stages: base pivot is the center of the screen.
  • Motifs & storyboards: base pivot is the top-left of the screen.

Parameters (video-specific)

type (required, string)

Must be video.

path (required, string)

Path to the media file. By default it resolves relative to the engine’s video directory (you may also use absolute paths).

volume (optional, int)

Audio playback volume (defaults to 100).

loop (optional, boolean int)

Set to 1 to loop the video (defaults to 0).

scalemode (optional, string)

How the video frame is sized into the window (defaults to none):

  • none – No scaling.
  • center – No scaling; center the frame; crop/pad as needed.
  • fit – Uniform scale to fit entirely inside; letter/pillar-box if needed.
  • fitwidth – Match window width; center-crop vertically if taller; otherwise pad.
  • fitheight – Match window height; center-crop horizontally if wider; otherwise pad.
  • zoomfill – Uniform scale to fully cover window; center-crop overflow.
  • stretch – Non-uniform scale to exactly fill (may distort).

Element‐level transforms like scalestart/scaledelta and camera zoom (zoomdelta, zoomscaledelta) are applied in addition to the size implied by scalemode.

scalefilter (optional, string)

Scaling filter (defaults to fastbilinear). Options: lanczos, fastbilinear, bilinear, bicubic, experimental, neighbor, area, bicublin, gauss, sinc, spline.


Standard background parameters supported by type = video

The following work the same as for normal/anim elements unless noted.

  • layerno 0 draws behind characters; 1 draws in front. Back-to-front ordering still follows file order inside each layer.

  • Position & motion

    • start = x,y – Initial position relative to the base pivot (+x right, +y down).
    • delta = dx,dy – Parallax factor relative to camera movement.
    • velocity = vx,vy – Initial per-tick velocity (px/tick).
    • BGCtrls: VelSet, VelAdd, PosSet, PosAdd all work on video elements.
  • Sinusoidal motion

    • sin.x = amp, period, phase, sin.y = ... BGCtrls SinX / SinY also supported.
  • Identification & visibility

    • id – For controller targeting.
    • BGCtrl Visible – Hides/shows the element; time still advances (the video keeps playing while invisible, and the audio continues but is muted).
    • BGCtrl Enable – Disables/enables the element; time does not advance while disabled (video pauses and resumes).
  • Clipping windows

    • maskwindow = x1,y1,x2,y2 (preferred)
    • window = x1,y1,x2,y2 (deprecated; top-right–relative, endpoint-inclusive)
    • windowdelta = dx,dy – Camera-relative movement of the clipping window.
  • Scaling & zoom interaction

    • scalestart = sx,sy, scaledelta = dsx,dsy – Element scale and its camera-parallax response.
    • zoomdelta = d – How camera zoom affects this element (0 = no size change from camera zoom, 1 = match camera zoom).
    • zoomscaledelta – Applies additional element-scale change per unit of camera zoom, analogous to other elements.

Ignored / not applicable to type = video

  • Sprite/anim-only: spriteno, actionno, mask
  • Tiling: tile, tilespacing
  • Parallax-only: width, xscale, yscalestart, yscaledelta, rasterx, autoresizeparallax, xbottomzoomdelta
  • Blending & palettes: trans, alpha, PalFX, RemapPal, and BGCtrls PalFX / RemapPal / Anim

Examples

Fullscreen stretch, minimal settings

[BG fullscreen_video]
type        = video
path        = video/intro.webm
scalemode   = stretch
scalefilter = bilinear

Basic looping background video behind characters

[BG city_video]
type        = video
path        = video/city_loop.webm
loop        = 1
volume      = 70
scalemode   = fit
scalefilter = fastbilinear
layerno     = 0
start       = 0,0
delta       = .25,.25
id          = 100

Foreground video banner with motion and visibility control

[BG banner]
type        = video
path        = video/banner.mkv
scalemode   = fitwidth
layerno     = 1
start       = 0,-30
delta       = 1,1
velocity    = .4, 0
scalestart  = 1,1
zoomdelta   = 0

[BGCtrlDef vid_ctrls]
looptime = -1

[BGCtrl hide_banner]
type  = Visible
time  = 600,900
value = 0
ctrlID = 101

[BGCtrl drift_right]
type = VelSet
time = 0,-1
x    = .4
ctrlID = 101

Clone this wiki locally