Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where is SoundManagerCreator.create? #4774

Closed
r-onodera opened this issue Oct 1, 2019 · 3 comments
Closed

Where is SoundManagerCreator.create? #4774

r-onodera opened this issue Oct 1, 2019 · 3 comments

Comments

@r-onodera
Copy link

Version

  • Phaser Version:

Phaser v3.19.0

  • Operating system:

Windwos 7 64bit

  • Browser:
    Google Chrome v77.0.3865.90 (64bit)

Description

In the definition of phaser.d.ts, SoundManagerCreator is a function and the return value is void.

However, SoundManagerCreator is actually a static class and has a create method.
The return value is NoAudioSoundManager, WebAudioSoundManager or HTML5AudioSoundManager.

The above is Google Translate of the following sentence.

phaser.d.tsの定義ではSoundManagerCreatorは関数で返り値がvoidです。

しかし実際にはSoundManagerCreatorは静的クラスであり、createメソッドを持っています。
また返す値がNoAudioSoundManager、WebAudioSoundManagerもしくはHTML5AudioSoundManagerです。

Example Test Code

const game = new Phaser.Game(config);

// TS2339: Property 'create' does not exist on type ''
const mng = Phaser.Sound.SoundManagerCreator.create(game);

types_SoundManagerCreator

https://github.com/photonstorm/phaser/blob/v3.19.0/src/sound/SoundManagerCreator.js
image

@photonstorm
Copy link
Collaborator

This function should not be called directly and is not public. Phaser already calls it automatically in the Game class.

@r-onodera
Copy link
Author

Oh...
I see. Thanks!

@photonstorm
Copy link
Collaborator

This issue has been mentioned on Phaser. There might be relevant details there:

https://phaser.discourse.group/t/is-it-possible-to-have-2-sound-managers/11354/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants