Home Reference Source
import {SoundProxy} from 'shapez.io/js/game/sound_proxy.js'
public class | source

SoundProxy

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public

root: *

Method Summary

Public Methods
public

Updates the list of ongoing sounds

public

play3D(id: string, pos: Vector): boolean

Plays a 3D sound whose volume is scaled based on where it was emitted

public

Plays a new ui sound

public

Plays the ui click sound

public

Plays the ui error sound

Public Constructors

public constructor(root: GameRoot) source

Params:

NameTypeAttributeDescription
root GameRoot

Public Members

public playing3DSounds: *[] source

public playingUiSounds: *[] source

public root: * source

Public Methods

public internalUpdateOngoingSounds() source

Updates the list of ongoing sounds

public play3D(id: string, pos: Vector): boolean source

Plays a 3D sound whose volume is scaled based on where it was emitted

Params:

NameTypeAttributeDescription
id string

Sound ID

pos Vector

World space position

Return:

boolean

public playUi(id: string): boolean source

Plays a new ui sound

Params:

NameTypeAttributeDescription
id string

Sound ID

Return:

boolean

public playUiClick() source

Plays the ui click sound

public playUiError() source

Plays the ui error sound