sonolus.script.particle¶
Particle
¶
Bases: Record
A particle effect.
is_available: bool
property
¶
Check if the particle effect is available.
spawn(quad: QuadLike, duration: float, loop: bool = False) -> ParticleHandle
¶
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. |
ParticleGroup
¶
ParticleHandle
¶
StandardParticle
¶
Standard particles.
particle(name: str) -> Any
¶
Define a particle with the given name.
particle_group(names: Iterable[str]) -> Any
¶
Define a particle group with the given names.
particles(cls: type[T]) -> T | Particles
¶
Decorator to define particles.
Usage
@particles
class Particles:
tap: StandardParticle.NOTE_CIRCULAR_TAP_RED
other: Particle = particle("other")
group_1: ParticleGroup = particle_group(["one", "two", "three"])
group_2: ParticleGroup = particle_group(f"name_{i}" for i in range(10))