Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/remapper/src/cinema.ts>CinemaScreen

A framework for Beat Saber map scripting.
Latest
class CinemaScreen
import { CinemaScreen } from "https://deno.land/x/remapper@3.1.2/src/cinema.ts";

Constructors

new
CinemaScreen(
cinemaLookupMethod: CINEMA_LOOKUP,
videoID: string,
videoFile?: string,
)

Cinema Screen object for ease of creation

Properties

allowCustomPlatform: boolean

When set to false, will prevent the CustomPlatforms mod from loading a custom platform for this map if the video is playing. Can be used to override the user setting if the user set it to true for all maps.

author: string

The name of the video's uploader. Will be shown to the user.

bloom: number

Sets the amount of bloom (glow) that appears around the video player during brightly colored parts of the video.

colorCorrection: ColorCorrection

If you want to make slight modifications to how the video looks, you can use these color correction options which get applied at runtime. This should be easier to use than having to make the edits in the video file itself and then re-uploading the edited version to YouTube. These settings are categorized under a top-level property named colorCorrection. See the example below. When adjusting these values, you can make use of the hot reloading capability of Cinema. Simply start the map, pause the game at a frame of the video you want to look differently, and start editing the config to see the results immediately.

configByMapper: boolean

Used to indicate whether the config was created by the mapper (as opposed to by the user). Changes the UI in various small ways.

curvature: number

Use this setting to force a specific curvature of the screen. The allowed range of values is 0-180 (degrees). Setting this to 0 forces curvature to be disabled. If this parameter is not included and the user has curvature enabled, the curvature is calculated automatically based on the distance and the width of the screen.

disableDefaultModifications: boolean

If set to true, will disable any environment modifications Cinema does by default for the selected environment. Only use this if you plan on modifying the environment in a different way to make the video player fit in.

duration: number

Video duration in seconds. Will be shown to the user, but has no other function than that.

endVideoAt: number

This parameter allows you to let a video end early (e.g. to hide sponsor segments, credits, logos etc.). The time references the video time, not the map time. The video will start fading out one second before this time is reached. Value is in seconds (e.g.: 296.5 would be 4 minutes and 56.5 seconds)

environmentName: string

The environment that is supposed to be loaded. This allows you to force a specific environment that is only used if the user has Cinema installed and the video downloaded. This also disables the user's choice in the Override Environment setting of the base game, so please only use it if you have a good reason to do so.

forceEnvironmentModifications: boolean

Set this to true to have your environment modifications applied even if no video is defined or downloaded by the user.

height: number

Determines the size of the screen. There is no setting for the width, since that is calculated automatically by the height and the aspect ratio of the video. If you change the height, you might want to also change the y positioning of the screen so it doesn't float above the ground. This setting prevents the user from overriding the environment.

json: Json
loop: boolean

Whether the video should loop if it ends before the map does.

mergePropGroups: boolean

If this is set to true, all cloned lights will be merged with existing prop groups, based on the specified z-position. Note: This will make lighting using light IDs nearly impossible, if you plan on using that. Also, if your cloned light is placed at a z-position where no pre-existing lights are, a new prop group will be created, which will change the IDs of other prop groups and potentially mess up your lightshow.

offset: number

The offset in milliseconds to align the video with the map. Use the video menu in-game to determine the offset.

playbackSpeed: number

Allows you to adjust the playback speed of the video.

position: [number, number, number]

This setting can be used to create a custom positioning of the video player. x is the deviation from the center, y is up/down and z controls the distance. y should usually be about half of the video height minus 0.1 if you want the video to be above the track. This setting prevents the user from overriding the environment.

rotation: [number, number, number]

Rotates the video screen. By default, it tilts down by 8 degrees for better visibility.

subsurfaces: number

This allows you to specify how many sub-surfaces the curved screen uses, which lets you control the smoothness of the curvature. Valid range is 1 to 256. The default of 32 looks great in most cases and doesn't cost much performance.

title: string

The title of the video. Will be shown to the user.

transparency: boolean

Include this in your config if you want to override the user's choice and force transparency to be enabled or disabled. This does not disable the color blending, it only prevents light sources behind the screen from shining through.

videoFile: string

Name of the video file on the local file system. Path is not included, the file is assumed to be in the map's folder. Will be set automatically after downloading and set to the title of the video, with illegal characters replaced by _.

videoID: string

The YouTube video ID from the part after the &v= in the URL, e.g.: youtube.com/watch?v=_qwnHeMKbVA

videoUrl: string

Use this parameter instead of videoID if you want to use a video hoster other than YouTube. Provide the full video URL for this parameter. Currently supported are the following video sources: YouTube, Facebook, Dailymotion, Vimeo.

vignette: Vignette

Using the vignette effect you can change the shape of the video player or soften its edges.

Methods

import(json: Json)

Create a Cinema Screen using Json.

Push Main Cinema Screen to cinema-video.json