Files
aego/modules/particles/templates.go
T
sanspie a6822156cd
ci-platforms / windows amd64 smoke (push) Skipped
ci / release (push) Successful in 8m58s
ci-platforms / darwin amd64 smoke (push) Skipped
ci-platforms / darwin arm64 smoke (push) Skipped
ci / checks (push) Successful in 4m46s
ci / build (amd64, linux, ubuntu-24.04) (push) Successful in 13m28s
Finish Stage 12 editor fixes and refreshed platformer
2026-11-05 17:36:42 +03:00

23 lines
596 B
Go

//go:build !aego_runtime
package particles
import (
"aego/engine/module"
"aego/scene"
"aego/schema"
"strings"
)
func registerPresets(r *module.Registry) {
for _, name := range presetNames {
id := strings.ToLower(name)
r.Template(schema.TemplateDesc{ID: ID + "." + id, Name: name, Menu: "Effects", Category: "Effects", Icon: "particles." + id, Space: schema.Space2D, Setup: func(sc *scene.Scene, h scene.NodeHandle) {
data, _ := PresetSource(name)
if c, err := ReadPreset(sc.Types(), sc.Resolver(), data); err == nil {
*scene.Add[ParticleSystem2D](sc, h) = c
}
}})
}
}