presets

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 5 Imported by: 0

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

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 GetPreset

func GetPreset(index int) Preset

GetPreset returns a preset by index.

func GetPresetByName

func GetPresetByName(name string) Preset

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL