Skip to main content

Background

const bg = new Background(
osbPath: string,
folderPath: string,
startTime: number | string,
endTime: number | string,
opacity: number = 0.8,
fadeDuration: number = 500
)

Set background between start and end time.

  • osbPath: relative path to image file. For example, if you have a folder named sb inside your beatmap folder and your image.jpg is in it, then it should be sb/image.jpg
  • folderPath: full path to beatmap folder
  • startTime/endTime: times in milliseconds/timestamp indicate when the image will be shown.
  • options: Available options:
interface IBackgroundOptions {
/**
* Opacity of the image
* @default 0.8
*/
opacity?: number
/**
* How long (in milliseconds) should the image start fading in/out.
* @default 500
*/
fadeDuration?: number
}

Example

const folderPath = "D:/osu!/Songs/map_folder"
const bg = new Background("sb/bg.jpg", folderPath, 1000, 2000, 1, 200)

scene.registerComponents(bg)