Class: Storyboard
Defined in: src/beatmap/storyboard/storyboard.ts:20
A mutable osu! storyboard containing layers, drawable elements, and timing commands. Use getLayer to acquire layers, then add sprites, animations, or samples to them.
import { Storyboard } from 'osu-files'
const storyboard = new Storyboard()
const layer = storyboard.getLayer('Foreground')
return { name: layer.name, depth: layer.depth }Constructors
new Storyboard():
Storyboard
Returns
Storyboard
import { Storyboard } from 'osu-files'
const storyboard = new Storyboard()
const layer = storyboard.getLayer('Foreground')
return { name: layer.name, depth: layer.depth }Properties
backgroundOffset
backgroundOffset:
object
Defined in: src/beatmap/storyboard/storyboard.ts:24
x
x:
number=0
y
y:
number=0
variables
variables:
Record<string,string> ={}
Defined in: src/beatmap/storyboard/storyboard.ts:22
Accessors
earliestEventTime
get earliestEventTime():
number|undefined
Defined in: src/beatmap/storyboard/storyboard.ts:83
The earliest command or element time, if the storyboard has events.
Returns
number | undefined
import { Storyboard } from 'osu-files'
const storyboard = new Storyboard()
return storyboard.earliestEventTimehasDrawable
get hasDrawable():
boolean
Defined in: src/beatmap/storyboard/storyboard.ts:75
Whether any layer contains a drawable storyboard element.
Returns
boolean
import { Storyboard } from 'osu-files'
const storyboard = new Storyboard()
return storyboard.hasDrawablelatestEventTime
get latestEventTime():
number|undefined
Defined in: src/beatmap/storyboard/storyboard.ts:95
The latest command or element time, if the storyboard has events.
Returns
number | undefined
import { Storyboard } from 'osu-files'
const storyboard = new Storyboard()
return storyboard.latestEventTimeMethods
clearLayers()
clearLayers():
void
Defined in: src/beatmap/storyboard/storyboard.ts:67
Removes every layer and its elements.
Returns
void
import { Storyboard } from 'osu-files'
const storyboard = new Storyboard()
storyboard.getLayer('Foreground')
storyboard.clearLayers()
return storyboard.layers.sizegetLayer()
getLayer(
name):StoryboardLayer
Defined in: src/beatmap/storyboard/storyboard.ts:32
Returns an existing layer or creates it with the standard osu! depth.
Parameters
| Parameter | Type |
|---|---|
name | StoryboardLayerName |
Returns
import { Storyboard } from 'osu-files'
const storyboard = new Storyboard()
const layer = storyboard.getLayer('Foreground')
return { name: layer.name, depth: layer.depth }hasLayer()
hasLayer(
name):boolean
Defined in: src/beatmap/storyboard/storyboard.ts:43
Checks whether a named layer exists.
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
boolean
import { Storyboard } from 'osu-files'
const storyboard = new Storyboard()
storyboard.getLayer('Foreground')
return storyboard.hasLayer('Foreground')removeLayer()
removeLayer(
nameOrLayer):void
Defined in: src/beatmap/storyboard/storyboard.ts:46
Removes a layer by name or by object reference.
Parameters
| Parameter | Type |
|---|---|
nameOrLayer | string | StoryboardLayer |
Returns
void
import { Storyboard } from 'osu-files'
const storyboard = new Storyboard()
storyboard.getLayer('Foreground')
storyboard.removeLayer('Foreground')
return storyboard.hasLayer('Foreground')renameLayer()
renameLayer(
oldName,newName):void
Defined in: src/beatmap/storyboard/storyboard.ts:57
Renames a layer while preserving its elements and depth.
Parameters
| Parameter | Type |
|---|---|
oldName | string |
newName | StoryboardLayerName |
Returns
void
import { Storyboard } from 'osu-files'
const storyboard = new Storyboard()
storyboard.getLayer('Foreground')
storyboard.renameLayer('Foreground', 'Overlay')
return storyboard.hasLayer('Overlay')