Skip to content

sonolus.script.particle

Particle

Bases: Record

A particle effect.

is_available()

Check if the particle effect is available.

spawn(quad, duration, loop=False)

Spawn the particle effect.

Parameters:

Name Type Description Default
quad QuadLike

The quad to spawn the particle effect on.

required
duration float

The duration of the particle effect.

required
loop bool

Whether to loop the particle effect.

False

Returns:

Name Type Description
ParticleHandle ParticleHandle

A handle to the spawned particle effect.

ParticleHandle

Bases: Record

A handle to a looping particle effect.

destroy()

Destroy the particle effect.

move(quad)

Move the particle effect to a new location.

Parameters:

Name Type Description Default
quad QuadLike

The new quad to move the particle effect to.

required

StandardParticle

Standard particles.

particle(name)

Define a particle with the given name.

particles(cls)

Decorator to define particles.

Usage
@particles
class Particles:
    tap: StandardParticle.NOTE_CIRCULAR_TAP_RED
    other: Particle = particle("other")