Documentation
¶
Index ¶
- func ExportConstants() map[string]string
- func Load(fileSystem vfs.Opener) error
- func LoadFolder(folder string) error
- type Id
- type Scheduler
- func (fs *Scheduler) Clear()
- func (fs *Scheduler) PlaySoundEffectAt(id Id, at float64)
- func (fs *Scheduler) PlaySoundEffectAtFadeIn(id Id, at float64, fadeIn time.Duration)
- func (fs *Scheduler) PlaySoundEffectAtRandomFadeIn(id Id, at float64, maxFadeInMilliSeconds int)
- func (fs *Scheduler) Process(now float64)
- type Sfx
- type SfxVariant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportConstants ¶
ExportConstants is used to export all currently loaded SFX, in a format that can be used to generate go constants.
func Load ¶
Load loads sound effects from a virtual filesystem. At the root of the filesystem there must be a "sfx.json" file, which references any files to be loaded
func LoadFolder ¶
LoadFolder loads sound effects from a regular folder. See Load for more information.
Types ¶
type Id ¶
type Id string
Id is used to identify a specific sound effect Use Play to play the sounds after loading them
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler lets you register sounds that should play in the future.
If you are making a simulation game, the time is likely virtual, and this lets you use any time notion. If you use real time, just pass time.Now().Seconds() as the time.
Scheduler can be used to schedule sounds to match timed animations, without needing to worry about executing it at exactly the right time.
Remember to call Scheduler.Process() from your game loop.
func NewScheduler ¶
func NewScheduler() *Scheduler