Documentation
¶
Overview ¶
Package presets provides predefined particle configurations for Particle Symphony.
Each preset defines a unique visual effect by configuring initial particle properties and emitter behavior. Presets implement the Preset interface and can be switched at runtime using keyboard shortcuts (1-5).
Available Presets ¶
- Galaxy: Spiral galaxy with rotating particles
- Firework: Colorful explosion bursts with gravity
- Swarm: Organic swarm behavior following attractors
- Fountain: Water fountain shooting upward
- Chaos: Random particles with varied colors and velocities
Usage ¶
Get and apply a preset:
preset := presets.GetPreset(0) // Galaxy preset.Apply(entityManager, config)
Custom Presets ¶
Implement the Preset interface to create custom effects:
type myPreset struct{}
func (p *myPreset) Name() string { return "MyPreset" }
func (p *myPreset) Description() string { return "Custom effect" }
func (p *myPreset) Apply(em ecs.EntityManager, cfg *config.Config) { ... }
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Registry = []Preset{ NewGalaxyPreset(), NewFireworkPreset(), NewSwarmPreset(), NewFountainPreset(), NewChaosPreset(), }
Registry holds all available presets.
Functions ¶
func ClearParticles ¶
func ClearParticles(em ecs.EntityManager)
ClearParticles removes all particle entities from the entity manager.
Types ¶
type Preset ¶
type Preset interface {
Name() string
Description() string
Apply(em ecs.EntityManager, cfg *config.Config)
}
Preset defines the interface for particle presets.
func GetPresetByName ¶
GetPresetByName returns a preset by name.
func NewChaosPreset ¶
func NewChaosPreset() Preset
NewChaosPreset creates a new chaos preset instance.
func NewFireworkPreset ¶
func NewFireworkPreset() Preset
NewFireworkPreset creates a new firework preset instance.
func NewFountainPreset ¶
func NewFountainPreset() Preset
NewFountainPreset creates a new fountain preset instance.
func NewGalaxyPreset ¶
func NewGalaxyPreset() Preset
NewGalaxyPreset creates a new galaxy preset instance.
func NewSwarmPreset ¶
func NewSwarmPreset() Preset
NewSwarmPreset creates a new swarm preset instance.