mirror of
https://github.com/photonstorm/phaser
synced 2024-12-18 17:16:03 +00:00
1 line
18 KiB
JSON
1 line
18 KiB
JSON
|
{"class":{"name":"Phaser.Sound","extends":"","static":false,"constructor":true,"parameters":[{"name":"game","type":["Phaser.Game"],"help":"Reference to the current game instance.","optional":false,"default":null},{"name":"key","type":["string"],"help":"Asset key for the sound.","optional":false,"default":null},{"name":"volume","type":["number"],"help":"Default value for the volume, between 0 and 1.","optional":true,"default":"1"},{"name":"loop","type":["boolean"],"help":"Whether or not the sound will loop.","optional":true,"default":"false"}],"help":"The Sound class constructor."},"consts":[],"methods":{"public":[{"name":"addMarker","static":false,"returns":null,"help":"Adds a marker into the current Sound. A marker is represented by a unique key and a start time and duration.\\nThis allows you to bundle multiple sounds together into a single audio file and use markers to jump between them for playback.","line":346,"public":true,"protected":false,"private":false,"parameters":[{"name":"name","type":["string"],"help":"A unique name for this marker, i.e. 'explosion', 'gunshot', etc.","optional":false,"default":null},{"name":"start","type":["number"],"help":"The start point of this marker in the audio file, given in seconds. 2.5 = 2500ms, 0.5 = 500ms, etc.","optional":false,"default":null},{"name":"duration","type":["number"],"help":"The duration of the marker in seconds. 2.5 = 2500ms, 0.5 = 500ms, etc.","optional":false,"default":null},{"name":"volume","type":["number"],"help":"The volume the sound will play back at, between 0 (silent) and 1 (full volume).","optional":true,"default":"1"},{"name":"loop","type":["boolean"],"help":"Sets if the sound will loop or not.","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"destroy","static":false,"returns":null,"help":"Destroys this sound and all associated events and removes it from the SoundManager.","line":881,"public":true,"protected":false,"private":false,"parameters":[{"name":"remove","type":["boolean"],"help":"If true this Sound is automatically removed from the SoundManager.","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""},{"name":"fadeIn","static":false,"returns":null,"help":"Starts this sound playing (or restarts it if already doing so) and sets the volume to zero.\\nThen increases the volume from 0 to 1 over the duration specified.\\nAt the end of the fade Sound.onFadeComplete is dispatched with this Sound object as the first parameter,\\nand the final volume (1) as the second parameter.","line":799,"public":true,"protected":false,"private":false,"parameters":[{"name":"duration","type":["number"],"help":"The time in milliseconds over which the Sound should fade in.","optional":true,"default":"1000"},{"name":"loop","type":["boolean"],"help":"Should the Sound be set to loop? Note that this doesn't cause the fade to repeat.","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"fadeOut","static":false,"returns":null,"help":"Decreases the volume of this Sound from its current value to 0 over the duration specified.\\nAt the end of the fade Sound.onFadeComplete is dispatched with this Sound object as the first parameter,\\nand the final volume (0) as the second parameter.","line":822,"public":true,"protected":false,"private":false,"parameters":[{"name":"duration","type":["number"],"help":"The time in milliseconds over which the Sound should fade out.","optional":true,"default":"1000"}],"inherited":false,"inheritedFrom":""},{"name":"fadeTo","static":false,"returns":null,"help":"Fades the volume of this Sound from its current value to the given volume over the duration specified.\\nAt the end of the fade Sound.onFadeComplete is dispatched with this Sound object as the first parameter,\\nand the final volume (volume) as the second parameter.","line":837,"public":true,"protected":false,"private":false,"parameters":[{"name":"duration","type":["number"],"help":"The time in milliseconds during which the Sound should fade out.","optional":true,"default":"1000"},{"name":"volume","type":["number"],"h
|