Skip to main content

Class: SoundComponent

Defined in: audio/components/sound-component.ts:7

Component to manage sounds in the game.

Implements

Constructors

Constructor

new SoundComponent(options, playSound): SoundComponent

Defined in: audio/components/sound-component.ts:27

Creates an instance of SoundComponent.

Parameters

options

HowlOptions

The HowlOptions to configure the sound.

playSound

boolean = false

A boolean indicating whether to play the sound immediately.

Returns

SoundComponent

See

Documentation

Example

const soundComponent = new SoundComponent({
src: ['sound.mp3'],
volume: 0.5,
}, true);

Properties

name

name: symbol

Defined in: audio/components/sound-component.ts:8

The unique name of the component.

Implementation of

Component.name


playSound

playSound: boolean

Defined in: audio/components/sound-component.ts:10


sound

sound: Howl

Defined in: audio/components/sound-component.ts:9


symbol

readonly static symbol: typeof symbol

Defined in: audio/components/sound-component.ts:12