Documentation ¶
Index ¶
- Variables
- func Init(masterVolume, mVolume, sVolume float64)
- func NewBar(ctx *scene.Context, kind VolumeKind, pos floatgeom.Point2, w, h int) *entities.Entity
- func PlayOneOfSFX(files ...string)
- func PlaySFX(s string) error
- func SetMasterVolume(eh event.Handler, masterVolume float64)
- func SetSFXVolume(eh event.Handler, newVolume float64)
- type DashedLine
- type VolumeChangePayload
- type VolumeKind
Constants ¶
This section is empty.
Variables ¶
View Source
var EventVolumeChange = event.RegisterEvent[VolumeChangePayload]()
EventVolumeChange for any given volume type which should be one of the 3 supported.
Functions ¶
func Init ¶
func Init(masterVolume, mVolume, sVolume float64)
Init loads assets and initializes volume levels. It will do nothing after it has been called once.
func PlayOneOfSFX ¶
func PlayOneOfSFX(files ...string)
PlayOneOfSFX playes a random entry from the provided files
func SetMasterVolume ¶
SetMasterVolume value and update all volume values based of the given value.
func SetSFXVolume ¶
SetSFXVolume for grove's sound component
Types ¶
type DashedLine ¶
type DashedLine struct { render.LayeredPoint Dims intgeom.Point2 OnColor color.RGBA OffColor color.RGBA DashMod int Progress float64 }
DashedLine to display the current value on the bar.
type VolumeChangePayload ¶
type VolumeChangePayload struct { Kind VolumeKind `json:"kind,omitempty"` NewVolume float64 `json:"new_volume,omitempty"` }
VolumeChangePayload encodes that type of volume to manipulate and the volume to set to.
type VolumeKind ¶
type VolumeKind int
VolumeKind details which type of volume should be manipulated by the bar
const ( KindMaster VolumeKind = iota KindMusic VolumeKind = iota KindSFX VolumeKind = iota )
Types of bars.
Click to show internal directories.
Click to hide internal directories.