Skip to content

sonolus.script.level

BpmChange

Bases: PlayArchetype

The standard bpm change archetype.

ExportedLevel

An exported Sonolus level.

write_to_dir(path)

Write the exported level to a directory.

Level

A Sonolus level.

Parameters:

Name Type Description Default
name str

The name of the level.

required
title AnyText | None

The title of the level.

None
rating int

The rating of the level.

0
artists AnyText

The artists of the level.

'Unknown'
author AnyText

The author of the level.

'Unknown'
cover Asset | None

The cover of the level.

None
bgm Asset | None

The background music of the level.

None
data LevelData

The data of the level.

required
use_skin str | None

The skin to use, overriding the engine skin.

None
use_background str | None

The background to use, overriding the engine background.

None
use_effect str | None

The effect to use, overriding the engine effect.

None
use_particle str | None

The particle to use, overriding the engine particle.

None
tags list[Tag] | None

The tags of the level.

None
description AnyText | None

The description of the level.

None
meta Any

Additional metadata of the level.

None

export(engine_name)

Export the level in a sonolus-pack compatible format.

Parameters:

Name Type Description Default
engine_name str

The name of the engine this level is for.

required

Returns:

Type Description
ExportedLevel

The exported level.

LevelData

The data of a Sonolus level.

Parameters:

Name Type Description Default
bgm_offset float

The background music audio offset.

required
entities list[PlayArchetype]

The entities of the level.

required

TimescaleChange

Bases: PlayArchetype

The standard timescale change archetype.

flatten_entities(entities)

Flatten a list of entities.

Parameters:

Name Type Description Default
entities EntityListArg

The list of entities.

required

Yields:

Type Description
PlayArchetype

The flattened entities.