Skip to main content

Class: AudioComponent

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

Component to manage audio in the game.

Extends

Constructors

Constructor

new AudioComponent(options, playSound): AudioComponent

Defined in: audio/components/audio-component.ts:24

Creates an instance of AudioComponent.

Parameters

options

HowlOptions

The HowlOptions to configure the sound.

playSound

boolean = false

A boolean indicating whether to play the sound immediately. Default is false.

Returns

AudioComponent

See

Documentation

Example

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

Overrides

Component.constructor

Properties

playSound

playSound: boolean

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


sound

sound: Howl

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

Accessors

id

Get Signature

get static id(): symbol

Defined in: ecs/types/Component.ts:12

The unique id of the component.

Returns

symbol

Inherited from

Component.id