Home Reference Source
import {SoundInterface} from 'shapez.io/js/platform/sound.js'
public class | source

SoundInterface

Direct Subclass:

SoundImplBrowser

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public
public
public
public
public
public
public

Method Summary

Public Methods
public

Deinits the sound

public

Returns the music volume

public

Returns the sound volume

public

Initializes the sound

public

loadSound(key: string): Promise<void>

Pre-Loads the given sounds

public

Focus change handler, called by the pap

public

play3DSound(key: string, worldPosition: Vector, root: GameRoot)

public
public
public

Sets the music volume

public

Sets the sound volume

Public Constructors

public constructor() source

Public Members

public app: Application source

public currentMusic: MusicInstanceInterface source

public musicClass: * source

public musicVolume: number source

public pageIsVisible: boolean source

public soundClass: * source

public soundVolume: number source

Public Methods

public deinitialize(): Promise<void> source

Deinits the sound

Return:

Promise<void>

public getMusicVolume(): number source

Returns the music volume

Return:

number

public getSoundVolume(): number source

Returns the sound volume

Return:

number

public initialize(): Promise<any> source

Initializes the sound

Return:

Promise<any>

public loadSound(key: string): Promise<void> source

Pre-Loads the given sounds

Params:

NameTypeAttributeDescription
key string

Return:

Promise<void>

public onPageRenderableStateChanged(pageIsVisible: boolean) source

Focus change handler, called by the pap

Params:

NameTypeAttributeDescription
pageIsVisible boolean

public play3DSound(key: string, worldPosition: Vector, root: GameRoot) source

Params:

NameTypeAttributeDescription
key string
worldPosition Vector
root GameRoot

public playThemeMusic(key: string) source

Params:

NameTypeAttributeDescription
key string

public playUiSound(key: string) source

Params:

NameTypeAttributeDescription
key string

public setMusicVolume(volume: number) source

Sets the music volume

Params:

NameTypeAttributeDescription
volume number

public setSoundVolume(volume: number) source

Sets the sound volume

Params:

NameTypeAttributeDescription
volume number