2013-10-03 00:21:08 +00:00
<!DOCTYPE html>
< html lang = "en" >
< head >
< meta charset = "utf-8" >
2015-03-23 23:46:30 +00:00
< title > Phaser Source: src/sound/Sound.js< / title >
2013-10-03 00:21:08 +00:00
<!-- [if lt IE 9]>
< script src = "//html5shiv.googlecode.com/svn/trunk/html5.js" > < / script >
<![endif]-->
2014-11-15 20:01:46 +00:00
< link type = "text/css" rel = "stylesheet" href = "styles/default.css" >
2013-10-03 00:21:08 +00:00
< link type = "text/css" rel = "stylesheet" href = "styles/sunlight.default.css" >
< link type = "text/css" rel = "stylesheet" href = "styles/site.cerulean.css" >
< / head >
< body >
2014-11-25 00:23:44 +00:00
2013-10-03 00:21:08 +00:00
< div class = "container-fluid" >
< div class = "navbar navbar-fixed-top navbar-inverse" >
2014-11-25 00:23:44 +00:00
< div style = "position: absolute; width: 143px; height: 31px; right: 10px; top: 10px; z-index: 1050" > < a href = "http://phaser.io" > < img src = "img/phaser.png" border = "0" / > < / a > < / div >
2013-10-03 00:21:08 +00:00
< div class = "navbar-inner" >
2014-11-25 00:23:44 +00:00
< a class = "brand" href = "index.html" > Phaser API< / a >
2013-10-03 00:21:08 +00:00
< ul class = "nav" >
2014-11-25 00:23:44 +00:00
2013-10-03 00:21:08 +00:00
< li class = "dropdown" >
2013-10-03 01:38:35 +00:00
< a href = "namespaces.list.html" class = "dropdown-toggle" data-toggle = "dropdown" > Namespaces< b
2013-10-03 00:21:08 +00:00
class="caret">< / b > < / a >
< ul class = "dropdown-menu " >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-0" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.html" > Phaser< / a >
2013-10-03 00:21:08 +00:00
< / li >
2015-10-15 11:06:38 +00:00
< li class = "class-depth-0" >
< a href = "Phaser.KeyCode.html" > KeyCode< / a >
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-0" >
< a href = "PIXI.html" > PIXI< / a >
< / li >
2013-10-03 00:21:08 +00:00
< / ul >
< / li >
< li class = "dropdown" >
< a href = "classes.list.html" class = "dropdown-toggle" data-toggle = "dropdown" > Classes< b
class="caret">< / b > < / a >
< ul class = "dropdown-menu " >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Animation.html" > Animation< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.AnimationManager.html" > AnimationManager< / a >
2013-10-03 00:21:08 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.AnimationParser.html" > AnimationParser< / a >
2013-10-03 00:21:08 +00:00
< / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.ArraySet.html" > ArraySet< / a >
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.ArrayUtils.html" > ArrayUtils< / a >
< / li >
2014-10-09 15:12:53 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.AudioSprite.html" > AudioSprite< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.BitmapData.html" > BitmapData< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.BitmapText.html" > BitmapText< / a >
< / li >
2016-06-17 00:11:24 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.Bullet.html" > Bullet< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Button.html" > Button< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Cache.html" > Cache< / a >
2013-10-03 00:21:08 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Camera.html" > Camera< / a >
2013-10-03 00:21:08 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Canvas.html" > Canvas< / a >
2013-10-03 00:21:08 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Circle.html" > Circle< / a >
2013-10-03 00:21:08 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Color.html" > Color< / a >
2013-10-03 00:21:08 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-2" >
< a href = "Phaser.Component.Angle.html" > Angle< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Animation.html" > Animation< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.AutoCull.html" > AutoCull< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Bounds.html" > Bounds< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.BringToTop.html" > BringToTop< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Core.html" > Core< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Crop.html" > Crop< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Delta.html" > Delta< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Destroy.html" > Destroy< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.FixedToCamera.html" > FixedToCamera< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Health.html" > Health< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.InCamera.html" > InCamera< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.InputEnabled.html" > InputEnabled< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.InWorld.html" > InWorld< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.LifeSpan.html" > LifeSpan< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.LoadTexture.html" > LoadTexture< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Overlap.html" > Overlap< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.PhysicsBody.html" > PhysicsBody< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Reset.html" > Reset< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.ScaleMinMax.html" > ScaleMinMax< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Smoothed.html" > Smoothed< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.Create.html" > Create< / a >
< / li >
< li class = "class-depth-1" >
< a href = "Phaser.Creature.html" > Creature< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Device.html" > Device< / a >
2013-10-03 00:21:08 +00:00
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.DeviceButton.html" > DeviceButton< / a >
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.DOM.html" > DOM< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Easing.html" > Easing< / a >
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Back.html" > Back< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Bounce.html" > Bounce< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Circular.html" > Circular< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Cubic.html" > Cubic< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Elastic.html" > Elastic< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Exponential.html" > Exponential< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Linear.html" > Linear< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Quadratic.html" > Quadratic< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Quartic.html" > Quartic< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Quintic.html" > Quintic< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Sinusoidal.html" > Sinusoidal< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-18 03:01:51 +00:00
< a href = "Phaser.Ellipse.html" > Ellipse< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Events.html" > Events< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.Filter.html" > Filter< / a >
< / li >
2014-09-09 14:36:56 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.FlexGrid.html" > FlexGrid< / a >
< / li >
< li class = "class-depth-1" >
< a href = "Phaser.FlexLayer.html" > FlexLayer< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Frame.html" > Frame< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.FrameData.html" > FrameData< / a >
2013-10-03 00:21:08 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Game.html" > Game< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-21 15:37:26 +00:00
< a href = "Phaser.GameObjectCreator.html" > GameObjectCreator< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.GameObjectFactory.html" > GameObjectFactory< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-05 06:29:17 +00:00
< a href = "Phaser.Gamepad.html" > Gamepad< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Graphics.html" > Graphics< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Group.html" > Group< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-08 07:24:22 +00:00
< a href = "Phaser.Image.html" > Image< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.ImageCollection.html" > ImageCollection< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Input.html" > Input< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.InputHandler.html" > InputHandler< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Key.html" > Key< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Keyboard.html" > Keyboard< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-05 06:29:17 +00:00
< a href = "Phaser.Line.html" > Line< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.LinkedList.html" > LinkedList< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Loader.html" > Loader< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.LoaderParser.html" > LoaderParser< / a >
2013-10-03 00:21:08 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Math.html" > Math< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.Matrix.html" > Matrix< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Mouse.html" > Mouse< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.MSPointer.html" > MSPointer< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Net.html" > Net< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.Particle.html" > Particle< / a >
< / li >
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Particles.html" > Particles< / a >
< / li >
2014-10-09 15:12:53 +00:00
< li class = "class-depth-2" >
< a href = "Phaser.Particles.Arcade.html" > Arcade< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Particles.Arcade.Emitter.html" > Emitter< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Physics.html" > Physics< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Physics.Arcade.html" > Arcade< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.Arcade.Body.html" > Body< / a >
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-3" >
2015-08-24 14:43:45 +00:00
< a href = "Phaser.Physics.Arcade.TilemapCollision.html" > TilemapCollision< / a >
2015-03-23 23:46:30 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.Ninja.html" > Ninja< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.Ninja.AABB.html" > AABB< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.Ninja.Body.html" > Body< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.Ninja.Circle.html" > Circle< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.Ninja.Tile.html" > Tile< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.html" > P2< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.Body.html" > Body< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.BodyDebug.html" > BodyDebug< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.CollisionGroup.html" > CollisionGroup< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.ContactMaterial.html" > ContactMaterial< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.DistanceConstraint.html" > DistanceConstraint< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-11 12:09:28 +00:00
< li class = "class-depth-3" >
< a href = "Phaser.Physics.P2.FixtureList.html" > FixtureList< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.GearConstraint.html" > GearConstraint< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.InversePointProxy.html" > InversePointProxy< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.LockConstraint.html" > LockConstraint< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.Material.html" > Material< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.PointProxy.html" > PointProxy< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.PrismaticConstraint.html" > PrismaticConstraint< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.RevoluteConstraint.html" > RevoluteConstraint< / a >
< / li >
2014-09-09 14:36:56 +00:00
< li class = "class-depth-3" >
< a href = "Phaser.Physics.P2.RotationalSpring.html" > RotationalSpring< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.Spring.html" > Spring< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Plugin.html" > Plugin< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.PluginManager.html" > PluginManager< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Point.html" > Point< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Pointer.html" > Pointer< / a >
< / li >
2015-10-15 11:06:38 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.PointerMode.html" > PointerMode< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-07 06:10:15 +00:00
< a href = "Phaser.Polygon.html" > Polygon< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.QuadTree.html" > QuadTree< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.RandomDataGenerator.html" > RandomDataGenerator< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Rectangle.html" > Rectangle< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.RenderTexture.html" > RenderTexture< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.RequestAnimationFrame.html" > RequestAnimationFrame< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.RetroFont.html" > RetroFont< / a >
< / li >
2014-09-09 14:36:56 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.Rope.html" > Rope< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.RoundedRectangle.html" > RoundedRectangle< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.ScaleManager.html" > ScaleManager< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Signal.html" > Signal< / a >
< / li >
2014-04-11 12:09:28 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.SignalBinding.html" > SignalBinding< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-05 06:29:17 +00:00
< a href = "Phaser.SinglePad.html" > SinglePad< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Sound.html" > Sound< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.SoundManager.html" > SoundManager< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Sprite.html" > Sprite< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-18 03:01:51 +00:00
< a href = "Phaser.SpriteBatch.html" > SpriteBatch< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Stage.html" > Stage< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.State.html" > State< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.StateManager.html" > StateManager< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Text.html" > Text< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.Tile.html" > Tile< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.Tilemap.html" > Tilemap< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.TilemapLayer.html" > TilemapLayer< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.TilemapParser.html" > TilemapParser< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.Tileset.html" > Tileset< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.TileSprite.html" > TileSprite< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Time.html" > Time< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.Timer.html" > Timer< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-05 06:29:17 +00:00
< a href = "Phaser.TimerEvent.html" > TimerEvent< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 00:21:08 +00:00
< a href = "Phaser.Touch.html" > Touch< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Tween.html" > Tween< / a >
< / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.TweenData.html" > TweenData< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.TweenManager.html" > TweenManager< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Utils.html" > Utils< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Utils.Debug.html" > Debug< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2015-07-22 14:31:30 +00:00
< a href = "Phaser.Video.html" > Video< / a >
2013-10-03 00:21:08 +00:00
< / li >
2016-06-17 00:11:24 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.Weapon.html" > Weapon< / a >
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-1" >
2015-07-22 14:31:30 +00:00
< a href = "Phaser.World.html" > World< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-07-22 14:31:30 +00:00
< a href = "PIXI.AbstractFilter.html" > AbstractFilter< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-07-22 14:31:30 +00:00
< a href = "PIXI.BaseTexture.html" > BaseTexture< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.CanvasBuffer.html" > CanvasBuffer< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.CanvasGraphics.html" > CanvasGraphics< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.CanvasMaskManager.html" > CanvasMaskManager< / a >
< / li >
2015-08-24 14:43:45 +00:00
< li class = "class-depth-1" >
< a href = "PIXI.CanvasPool.html" > CanvasPool< / a >
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-1" >
< a href = "PIXI.CanvasRenderer.html" > CanvasRenderer< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.CanvasTinter.html" > CanvasTinter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.ComplexPrimitiveShader.html" > ComplexPrimitiveShader< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.DisplayObject.html" > DisplayObject< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.DisplayObjectContainer.html" > DisplayObjectContainer< / a >
< / li >
2016-02-08 17:01:36 +00:00
< li class = "class-depth-1" >
< a href = "PIXI.EarCut.html" > EarCut< / a >
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-1" >
< a href = "PIXI.Event.html" > Event< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.EventTarget.html" > EventTarget< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.FilterTexture.html" > FilterTexture< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.Graphics.html" > Graphics< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.GraphicsData.html" > GraphicsData< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.PIXI.html" > PIXI< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.PixiFastShader.html" > PixiFastShader< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.PixiShader.html" > PixiShader< / a >
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.PolyK.html" > PolyK< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.PrimitiveShader.html" > PrimitiveShader< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.RenderTexture.html" > RenderTexture< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.Rope.html" > Rope< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.Sprite.html" > Sprite< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.SpriteBatch.html" > SpriteBatch< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.Strip.html" > Strip< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.StripShader.html" > StripShader< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.Texture.html" > Texture< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.TilingSprite.html" > TilingSprite< / a >
2014-11-15 20:01:46 +00:00
< / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.WebGLBlendModeManager.html" > WebGLBlendModeManager< / a >
2014-11-25 00:23:44 +00:00
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.WebGLFastSpriteBatch.html" > WebGLFastSpriteBatch< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.WebGLFilterManager.html" > WebGLFilterManager< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.WebGLRenderer.html" > WebGLRenderer< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< / ul >
< / li >
< li class = "dropdown" >
< a href = "global.html" class = "dropdown-toggle" data-toggle = "dropdown" > Global< b
class="caret">< / b > < / a >
< ul class = "dropdown-menu " >
2016-06-03 17:48:34 +00:00
< li class = "class-depth-0" >
< a href = "global.html#ANGLE_DOWN" > ANGLE_DOWN< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ANGLE_LEFT" > ANGLE_LEFT< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ANGLE_NORTH_EAST" > ANGLE_NORTH_EAST< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ANGLE_NORTH_WEST" > ANGLE_NORTH_WEST< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ANGLE_RIGHT" > ANGLE_RIGHT< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ANGLE_SOUTH_EAST" > ANGLE_SOUTH_EAST< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ANGLE_SOUTH_WEST" > ANGLE_SOUTH_WEST< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ANGLE_UP" > ANGLE_UP< / a >
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#AUTO" > AUTO< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#BITMAPDATA" > BITMAPDATA< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#BITMAPTEXT" > BITMAPTEXT< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
< a href = "global.html#blendModes" > blendModes< / a >
2014-11-15 20:01:46 +00:00
< / li >
2016-06-17 00:11:24 +00:00
< li class = "class-depth-0" >
< a href = "global.html#BOTTOM_CENTER" > BOTTOM_CENTER< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#BOTTOM_LEFT" > BOTTOM_LEFT< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#BOTTOM_RIGHT" > BOTTOM_RIGHT< / a >
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#BUTTON" > BUTTON< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#CANVAS" > CANVAS< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#CANVAS_FILTER" > CANVAS_FILTER< / a >
< / li >
2016-06-17 00:11:24 +00:00
< li class = "class-depth-0" >
< a href = "global.html#CENTER" > CENTER< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-0" >
< a href = "global.html#CIRCLE" > CIRCLE< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#CREATURE" > CREATURE< / a >
< / li >
2016-06-09 16:13:31 +00:00
< li class = "class-depth-0" >
< a href = "global.html#displayList" > displayList< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-0" >
< a href = "global.html#DOWN" > DOWN< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ELLIPSE" > ELLIPSE< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#EMITTER" > EMITTER< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#GAMES" > GAMES< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#GRAPHICS" > GRAPHICS< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#GROUP" > GROUP< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#HEADLESS" > HEADLESS< / a >
< / li >
2016-06-09 16:13:31 +00:00
< li class = "class-depth-0" >
< a href = "global.html#HORIZONTAL" > HORIZONTAL< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-0" >
< a href = "global.html#IMAGE" > IMAGE< / a >
< / li >
2016-06-03 17:48:34 +00:00
< li class = "class-depth-0" >
< a href = "global.html#intersectsRectangle" > intersectsRectangle< / a >
< / li >
2016-06-09 16:13:31 +00:00
< li class = "class-depth-0" >
< a href = "global.html#LANDSCAPE" > LANDSCAPE< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-0" >
< a href = "global.html#LEFT" > LEFT< / a >
< / li >
2016-06-17 00:11:24 +00:00
< li class = "class-depth-0" >
< a href = "global.html#LEFT_BOTTOM" > LEFT_BOTTOM< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#LEFT_CENTER" > LEFT_CENTER< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#LEFT_TOP" > LEFT_TOP< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-0" >
< a href = "global.html#LINE" > LINE< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#MATRIX" > MATRIX< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#NONE" > NONE< / a >
< / li >
2016-02-08 17:01:36 +00:00
< li class = "class-depth-0" >
< a href = "global.html#PENDING_ATLAS" > PENDING_ATLAS< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-0" >
< a href = "global.html#POINT" > POINT< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#POINTER" > POINTER< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#POLYGON" > POLYGON< / a >
< / li >
2016-06-09 16:13:31 +00:00
< li class = "class-depth-0" >
< a href = "global.html#PORTRAIT" > PORTRAIT< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-0" >
< a href = "global.html#RECTANGLE" > RECTANGLE< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#RENDERTEXTURE" > RENDERTEXTURE< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#RETROFONT" > RETROFONT< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#RIGHT" > RIGHT< / a >
2014-11-15 20:01:46 +00:00
< / li >
2016-06-17 00:11:24 +00:00
< li class = "class-depth-0" >
< a href = "global.html#RIGHT_BOTTOM" > RIGHT_BOTTOM< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#RIGHT_CENTER" > RIGHT_CENTER< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#RIGHT_TOP" > RIGHT_TOP< / a >
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#ROPE" > ROPE< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#ROUNDEDRECTANGLE" > ROUNDEDRECTANGLE< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
< a href = "global.html#scaleModes" > scaleModes< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#SPRITE" > SPRITE< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#SPRITEBATCH" > SPRITEBATCH< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#TEXT" > TEXT< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#TILEMAP" > TILEMAP< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#TILEMAPLAYER" > TILEMAPLAYER< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#TILESPRITE" > TILESPRITE< / a >
< / li >
2016-06-17 00:11:24 +00:00
< li class = "class-depth-0" >
< a href = "global.html#TOP_CENTER" > TOP_CENTER< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#TOP_LEFT" > TOP_LEFT< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#TOP_RIGHT" > TOP_RIGHT< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-0" >
< a href = "global.html#UP" > UP< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#VERSION" > VERSION< / a >
< / li >
2016-06-09 16:13:31 +00:00
< li class = "class-depth-0" >
< a href = "global.html#VERTICAL" > VERTICAL< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-0" >
< a href = "global.html#VIDEO" > VIDEO< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#WEBGL" > WEBGL< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#WEBGL_FILTER" > WEBGL_FILTER< / a >
2014-11-15 20:01:46 +00:00
< / li >
2013-10-03 00:21:08 +00:00
< / ul >
< / li >
2014-11-25 00:23:44 +00:00
2014-11-15 20:01:46 +00:00
< li class = "dropdown" >
2014-11-25 00:23:44 +00:00
< a href = "#" class = "dropdown-toggle" data-toggle = "dropdown" > Core< b class = "caret" > < / b > < / a >
< ul class = "dropdown-menu " >
2014-12-03 10:39:11 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Game.html" > Game< / a > < / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Group.html" > Group< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.World.html" > World< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Loader.html" > Loader< / a > < / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Cache.html" > Cache< / a > < / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Time.html" > Time< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Camera.html" > Camera< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.StateManager.html" > State Manager< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.TweenManager.html" > Tween Manager< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.SoundManager.html" > Sound Manager< / a > < / li >
2015-01-06 06:57:25 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Input.html" > Input Manager< / a > < / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "Phaser.ScaleManager.html" > Scale Manager< / a > < / li >
< / ul >
< / li >
2014-11-15 20:01:46 +00:00
2014-11-25 00:23:44 +00:00
< li class = "dropdown" >
< a href = "#" class = "dropdown-toggle" data-toggle = "dropdown" > Game Objects< b class = "caret" > < / b > < / a >
2014-11-15 20:01:46 +00:00
< ul class = "dropdown-menu " >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "Phaser.GameObjectFactory.html" > Factory (game.add)< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.GameObjectCreator.html" > Creator (game.make)< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Sprite.html" > Sprite< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Image.html" > Image< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Sound.html" > Sound< / a > < / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Video.html" > Video< / a > < / li >
2015-01-06 06:57:25 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Particles.Arcade.Emitter.html" > Particle Emitter< / a > < / li >
2014-12-03 10:39:11 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Particle.html" > Particle< / a > < / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Text.html" > Text< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Tween.html" > Tween< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.BitmapText.html" > BitmapText< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Tilemap.html" > Tilemap< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.BitmapData.html" > BitmapData< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.RetroFont.html" > RetroFont< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Button.html" > Button< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Animation.html" > Animation< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Graphics.html" > Graphics< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.RenderTexture.html" > RenderTexture< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.TileSprite.html" > TileSprite< / a > < / li >
< / ul >
< / li >
< li class = "dropdown" >
< a href = "#" class = "dropdown-toggle" data-toggle = "dropdown" > Geometry< b class = "caret" > < / b > < / a >
< ul class = "dropdown-menu " >
< li class = "class-depth-1" > < a href = "Phaser.Circle.html" > Circle< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Ellipse.html" > Ellipse< / a > < / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Line.html" > Line< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Matrix.html" > Matrix< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Point.html" > Point< / a > < / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Polygon.html" > Polygon< / a > < / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Rectangle.html" > Rectangle< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.RoundedRectangle.html" > Rounded Rectangle< / a > < / li >
2014-11-25 00:23:44 +00:00
< / ul >
< / li >
2014-11-15 20:01:46 +00:00
2014-11-25 00:23:44 +00:00
< li class = "dropdown" >
< a href = "#" class = "dropdown-toggle" data-toggle = "dropdown" > Physics< b class = "caret" > < / b > < / a >
< ul class = "dropdown-menu " >
< li class = "class-depth-1" > < a href = "Phaser.Physics.Arcade.html" > Arcade Physics< / a > < / li >
< li class = "class-depth-2" > < a href = "Phaser.Physics.Arcade.Body.html" > Body< / a > < / li >
2016-06-17 00:11:24 +00:00
< li class = "class-depth-2" > < a href = "Phaser.Weapon.html" > Weapon< / a > < / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Physics.P2.html" > P2 Physics< / a > < / li >
< li class = "class-depth-2" > < a href = "Phaser.Physics.P2.Body.html" > Body< / a > < / li >
< li class = "class-depth-2" > < a href = "Phaser.Physics.P2.Spring.html" > Spring< / a > < / li >
< li class = "class-depth-2" > < a href = "Phaser.Physics.P2.CollisionGroup.html" > CollisionGroup< / a > < / li >
< li class = "class-depth-2" > < a href = "Phaser.Physics.P2.ContactMaterial.html" > ContactMaterial< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Physics.Ninja.html" > Ninja Physics< / a > < / li >
< li class = "class-depth-2" > < a href = "Phaser.Physics.Body.html" > Body< / a > < / li >
2014-11-15 20:01:46 +00:00
< / ul >
< / li >
2014-11-25 00:23:44 +00:00
< li class = "dropdown" >
< a href = "#" class = "dropdown-toggle" data-toggle = "dropdown" > Input< b class = "caret" > < / b > < / a >
< ul class = "dropdown-menu " >
< li class = "class-depth-1" > < a href = "Phaser.InputHandler.html" > Input Handler< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Pointer.html" > Pointer< / a > < / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" > < a href = "Phaser.DeviceButton.html" > Device Button< / a > < / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Mouse.html" > Mouse< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Keyboard.html" > Keyboard< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Key.html" > Key< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Gamepad.html" > Gamepad< / a > < / li >
< / ul >
< / li >
< li class = "dropdown" >
< a href = "#" class = "dropdown-toggle" data-toggle = "dropdown" > Community< b class = "caret" > < / b > < / a >
< ul class = "dropdown-menu " >
2015-03-26 02:55:18 +00:00
< li class = "class-depth-1" > < a href = "http://phaser.io" > Phaser Web Site< / a > < / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "https://github.com/photonstorm/phaser" > Phaser Github< / a > < / li >
2015-03-26 02:55:18 +00:00
< li class = "class-depth-1" > < a href = "http://phaser.io/examples" > Phaser Examples< / a > < / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "https://github.com/photonstorm/phaser-plugins" > Phaser Plugins< / a > < / li >
< li class = "class-depth-1" > < a href = "http://www.html5gamedevs.com/forum/14-phaser/" > Forum< / a > < / li >
< li class = "class-depth-1" > < a href = "http://stackoverflow.com/questions/tagged/phaser-framework" > Stack Overflow< / a > < / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" > < a href = "http://phaser.io/learn" > Tutorials< / a > < / li >
2016-05-19 11:36:51 +00:00
< li class = "class-depth-1" > < a href = "http://phaser.io/community/newsletter" > Newsletter< / a > < / li >
2015-03-26 02:55:18 +00:00
< li class = "class-depth-1" > < a href = "http://phaser.io/community/twitter" > Twitter< / a > < / li >
2016-06-17 00:11:24 +00:00
< li class = "class-depth-1" > < a href = "http://phaser.io/community/slack" > Slack< / a > < / li >
< li class = "class-depth-1" > < a href = "http://phaser.io/community/donate" > Donate< / a > < / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-1" > < a href = "https://www.codeandweb.com/texturepacker/phaser" > Texture Packer< / a > < / li >
2014-11-25 00:23:44 +00:00
< / ul >
< / li >
2013-10-03 00:21:08 +00:00
< / ul >
< / div >
< / div >
< div class = "row-fluid" >
< div class = "span12" >
< div id = "main" >
2015-03-23 23:46:30 +00:00
< h1 class = "page-title" > Source: src/sound/Sound.js< / h1 >
2013-10-03 00:21:08 +00:00
< section >
< article >
< pre class = "sunlight-highlight-javascript linenums" > /**
* @author Richard Davey < rich@photonstorm.com>
2016-04-22 14:15:28 +00:00
* @copyright 2016 Photon Storm Ltd.
2013-10-03 00:21:08 +00:00
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* The Sound class constructor.
*
* @class Phaser.Sound
* @constructor
* @param {Phaser.Game} game - Reference to the current game instance.
* @param {string} key - Asset key for the sound.
* @param {number} [volume=1] - Default value for the volume, between 0 and 1.
* @param {boolean} [loop=false] - Whether or not the sound will loop.
*/
2013-11-28 15:57:09 +00:00
Phaser.Sound = function (game, key, volume, loop, connect) {
2014-03-28 01:42:49 +00:00
2015-07-22 14:31:30 +00:00
if (volume === undefined) { volume = 1; }
if (loop === undefined) { loop = false; }
if (connect === undefined) { connect = game.sound.connectToMaster; }
2013-10-03 00:21:08 +00:00
/**
* A reference to the currently running Game.
* @property {Phaser.Game} game
*/
this.game = game;
/**
2013-11-28 15:57:09 +00:00
* @property {string} name - Name of the sound.
2013-10-03 00:21:08 +00:00
*/
this.name = key;
/**
2013-11-28 15:57:09 +00:00
* @property {string} key - Asset key for the sound.
2013-10-03 00:21:08 +00:00
*/
this.key = key;
/**
2014-04-29 14:39:02 +00:00
* @property {boolean} loop - Whether or not the sound or current sound marker will loop.
2013-10-03 00:21:08 +00:00
*/
this.loop = loop;
/**
2014-04-29 14:39:02 +00:00
* @property {number} volume - The sound or sound marker volume. A value between 0 (silence) and 1 (full volume).
2013-10-03 00:21:08 +00:00
*/
2014-04-29 14:39:02 +00:00
this.volume = volume;
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {object} markers - The sound markers.
2013-10-03 00:21:08 +00:00
*/
this.markers = {};
2014-03-28 01:42:49 +00:00
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {AudioContext} context - Reference to the AudioContext instance.
2013-10-03 00:21:08 +00:00
*/
this.context = null;
/**
2013-11-28 15:57:09 +00:00
* @property {boolean} autoplay - Boolean indicating whether the sound should start automatically.
2013-10-03 00:21:08 +00:00
*/
this.autoplay = false;
/**
2014-04-29 14:39:02 +00:00
* @property {number} totalDuration - The total duration of the sound in seconds.
2013-10-03 00:21:08 +00:00
*/
this.totalDuration = 0;
2014-03-28 01:42:49 +00:00
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {number} startTime - The time the Sound starts at (typically 0 unless starting from a marker)
2013-10-03 00:21:08 +00:00
* @default
*/
this.startTime = 0;
2014-03-28 01:42:49 +00:00
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {number} currentTime - The current time the sound is at.
2013-10-03 00:21:08 +00:00
*/
this.currentTime = 0;
2014-03-28 01:42:49 +00:00
2013-10-03 00:21:08 +00:00
/**
2014-04-29 14:39:02 +00:00
* @property {number} duration - The duration of the current sound marker in seconds.
2013-10-03 00:21:08 +00:00
*/
this.duration = 0;
2014-03-28 01:42:49 +00:00
2014-04-29 14:39:02 +00:00
/**
* @property {number} durationMS - The duration of the current sound marker in ms.
*/
this.durationMS = 0;
/**
* @property {number} position - The position of the current sound marker.
*/
this.position = 0;
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {number} stopTime - The time the sound stopped.
2013-10-03 00:21:08 +00:00
*/
this.stopTime = 0;
2014-03-28 01:42:49 +00:00
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {boolean} paused - true if the sound is paused, otherwise false.
2013-10-03 00:21:08 +00:00
* @default
*/
this.paused = false;
2014-03-28 01:42:49 +00:00
2013-10-25 15:54:40 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {number} pausedPosition - The position the sound had reached when it was paused.
2013-10-25 15:54:40 +00:00
*/
this.pausedPosition = 0;
/**
2013-11-28 15:57:09 +00:00
* @property {number} pausedTime - The game time at which the sound was paused.
2013-10-25 15:54:40 +00:00
*/
this.pausedTime = 0;
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {boolean} isPlaying - true if the sound is currently playing, otherwise false.
2013-10-03 00:21:08 +00:00
* @default
*/
this.isPlaying = false;
2014-03-28 01:42:49 +00:00
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {string} currentMarker - The string ID of the currently playing marker, if any.
2013-10-03 00:21:08 +00:00
* @default
*/
this.currentMarker = '';
2014-03-28 01:42:49 +00:00
2015-03-23 23:46:30 +00:00
/**
* @property {Phaser.Tween} fadeTween - The tween that fades the audio, set via Sound.fadeIn and Sound.fadeOut.
*/
this.fadeTween = null;
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {boolean} pendingPlayback - true if the sound file is pending playback
* @readonly
2013-10-03 00:21:08 +00:00
*/
this.pendingPlayback = false;
2014-03-28 01:42:49 +00:00
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {boolean} override - if true when you play this sound it will always start from the beginning.
2013-10-03 00:21:08 +00:00
* @default
*/
this.override = false;
2014-03-28 01:42:49 +00:00
2014-10-09 15:12:53 +00:00
/**
* @property {boolean} allowMultiple - This will allow you to have multiple instances of this Sound playing at once. This is only useful when running under Web Audio, and we recommend you implement a local pooling system to not flood the sound channels.
* @default
*/
this.allowMultiple = false;
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {boolean} usingWebAudio - true if this sound is being played with Web Audio.
* @readonly
2013-10-03 00:21:08 +00:00
*/
this.usingWebAudio = this.game.sound.usingWebAudio;
2014-03-28 01:42:49 +00:00
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {boolean} usingAudioTag - true if the sound is being played via the Audio tag.
2013-10-03 00:21:08 +00:00
*/
this.usingAudioTag = this.game.sound.usingAudioTag;
2013-11-28 15:57:09 +00:00
/**
2014-07-10 19:31:11 +00:00
* @property {object} externalNode - If defined this Sound won't connect to the SoundManager master gain node, but will instead connect to externalNode.
2013-11-28 15:57:09 +00:00
*/
this.externalNode = null;
2014-04-29 14:39:02 +00:00
/**
* @property {object} masterGainNode - The master gain node in a Web Audio system.
*/
this.masterGainNode = null;
/**
* @property {object} gainNode - The gain node in a Web Audio system.
*/
this.gainNode = null;
2015-03-23 23:46:30 +00:00
/**
* @property {object} _sound - Internal var.
* @private
*/
this._sound = null;
2013-10-03 00:21:08 +00:00
if (this.usingWebAudio)
{
this.context = this.game.sound.context;
this.masterGainNode = this.game.sound.masterGain;
2015-07-22 14:31:30 +00:00
if (this.context.createGain === undefined)
2013-10-03 00:21:08 +00:00
{
this.gainNode = this.context.createGainNode();
}
else
{
this.gainNode = this.context.createGain();
}
this.gainNode.gain.value = volume * this.game.sound.volume;
2013-11-28 15:57:09 +00:00
if (connect)
{
this.gainNode.connect(this.masterGainNode);
}
2013-10-03 00:21:08 +00:00
}
2015-03-23 23:46:30 +00:00
else if (this.usingAudioTag)
2013-10-03 00:21:08 +00:00
{
2015-03-23 23:46:30 +00:00
if (this.game.cache.getSound(key) & & this.game.cache.isSoundReady(key))
2013-10-03 00:21:08 +00:00
{
this._sound = this.game.cache.getSoundData(key);
this.totalDuration = 0;
if (this._sound.duration)
{
this.totalDuration = this._sound.duration;
}
}
else
{
this.game.cache.onSoundUnlock.add(this.soundHasUnlocked, this);
}
}
/**
2013-11-28 15:57:09 +00:00
* @property {Phaser.Signal} onDecoded - The onDecoded event is dispatched when the sound has finished decoding (typically for mp3 files)
2013-10-03 00:21:08 +00:00
*/
2013-11-28 15:57:09 +00:00
this.onDecoded = new Phaser.Signal();
2014-03-28 01:42:49 +00:00
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {Phaser.Signal} onPlay - The onPlay event is dispatched each time this sound is played.
2013-10-03 00:21:08 +00:00
*/
2013-11-28 15:57:09 +00:00
this.onPlay = new Phaser.Signal();
2014-03-28 01:42:49 +00:00
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {Phaser.Signal} onPause - The onPause event is dispatched when this sound is paused.
2013-10-03 00:21:08 +00:00
*/
2013-11-28 15:57:09 +00:00
this.onPause = new Phaser.Signal();
2014-03-28 01:42:49 +00:00
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {Phaser.Signal} onResume - The onResume event is dispatched when this sound is resumed from a paused state.
2013-10-03 00:21:08 +00:00
*/
2013-11-28 15:57:09 +00:00
this.onResume = new Phaser.Signal();
2014-03-28 01:42:49 +00:00
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {Phaser.Signal} onLoop - The onLoop event is dispatched when this sound loops during playback.
2013-10-03 00:21:08 +00:00
*/
2013-11-28 15:57:09 +00:00
this.onLoop = new Phaser.Signal();
2014-03-28 01:42:49 +00:00
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {Phaser.Signal} onStop - The onStop event is dispatched when this sound stops playback.
2013-10-03 00:21:08 +00:00
*/
2013-11-28 15:57:09 +00:00
this.onStop = new Phaser.Signal();
2014-03-28 01:42:49 +00:00
2013-10-03 00:21:08 +00:00
/**
2016-06-09 16:13:31 +00:00
* @property {Phaser.Signal} onMute - The onMute event is dispatched when this sound is muted.
2013-10-03 00:21:08 +00:00
*/
2013-11-28 15:57:09 +00:00
this.onMute = new Phaser.Signal();
2014-03-28 01:42:49 +00:00
2013-10-03 00:21:08 +00:00
/**
2013-11-28 15:57:09 +00:00
* @property {Phaser.Signal} onMarkerComplete - The onMarkerComplete event is dispatched when a marker within this sound completes playback.
2013-10-03 00:21:08 +00:00
*/
2013-11-28 15:57:09 +00:00
this.onMarkerComplete = new Phaser.Signal();
2013-10-03 00:21:08 +00:00
2014-10-09 15:12:53 +00:00
/**
* @property {Phaser.Signal} onFadeComplete - The onFadeComplete event is dispatched when this sound finishes fading either in or out.
*/
this.onFadeComplete = new Phaser.Signal();
2014-04-29 14:39:02 +00:00
/**
* @property {number} _volume - The global audio volume. A value between 0 (silence) and 1 (full volume).
* @private
*/
this._volume = volume;
/**
* @property {any} _buffer - Decoded data buffer / Audio tag.
* @private
*/
this._buffer = null;
/**
* @property {boolean} _muted - Boolean indicating whether the sound is muted or not.
* @private
*/
this._muted = false;
/**
* @property {number} _tempMarker - Internal marker var.
* @private
*/
this._tempMarker = 0;
/**
* @property {number} _tempPosition - Internal marker var.
* @private
*/
this._tempPosition = 0;
/**
* @property {number} _tempVolume - Internal marker var.
* @private
*/
this._tempVolume = 0;
2016-05-19 11:36:51 +00:00
/**
* @property {number} _tempPause - Internal marker var.
* @private
*/
this._tempPause = 0;
2014-04-29 14:39:02 +00:00
/**
2014-09-09 14:36:56 +00:00
* @property {number} _muteVolume - Internal cache var.
* @private
*/
this._muteVolume = 0;
/**
* @property {boolean} _tempLoop - Internal cache var.
2014-04-29 14:39:02 +00:00
* @private
*/
this._tempLoop = 0;
/**
* @property {boolean} _paused - Was this sound paused via code or a game event?
* @private
*/
this._paused = false;
2014-10-22 20:49:44 +00:00
2014-07-10 19:31:11 +00:00
/**
* @property {boolean} _onDecodedEventDispatched - Was the onDecoded event dispatched?
* @private
*/
this._onDecodedEventDispatched = false;
2015-07-22 14:31:30 +00:00
2013-10-03 00:21:08 +00:00
};
Phaser.Sound.prototype = {
2013-11-28 15:57:09 +00:00
/**
2013-10-03 00:21:08 +00:00
* Called automatically when this sound is unlocked.
2013-11-28 15:57:09 +00:00
* @method Phaser.Sound#soundHasUnlocked
* @param {string} key - The Phaser.Cache key of the sound file to check for decoding.
2013-10-03 00:21:08 +00:00
* @protected
2013-11-28 15:57:09 +00:00
*/
2013-10-03 00:21:08 +00:00
soundHasUnlocked: function (key) {
2014-09-09 14:36:56 +00:00
if (key === this.key)
2013-10-03 00:21:08 +00:00
{
this._sound = this.game.cache.getSoundData(this.key);
this.totalDuration = this._sound.duration;
2013-11-28 15:57:09 +00:00
}
},
2013-10-03 00:21:08 +00:00
/**
* Adds a marker into the current Sound. A marker is represented by a unique key and a start time and duration.
* This allows you to bundle multiple sounds together into a single audio file and use markers to jump between them for playback.
*
* @method Phaser.Sound#addMarker
* @param {string} name - A unique name for this marker, i.e. 'explosion', 'gunshot', etc.
* @param {number} start - The start point of this marker in the audio file, given in seconds. 2.5 = 2500ms, 0.5 = 500ms, etc.
2016-06-03 17:48:34 +00:00
* @param {number} [duration=1] - The duration of the marker in seconds. 2.5 = 2500ms, 0.5 = 500ms, etc.
2013-10-03 00:21:08 +00:00
* @param {number} [volume=1] - The volume the sound will play back at, between 0 (silent) and 1 (full volume).
* @param {boolean} [loop=false] - Sets if the sound will loop or not.
*/
addMarker: function (name, start, duration, volume, loop) {
2016-06-03 17:48:34 +00:00
if (duration === undefined || duration === null) { duration = 1; }
2015-07-22 14:31:30 +00:00
if (volume === undefined || volume === null) { volume = 1; }
if (loop === undefined) { loop = false; }
2013-10-03 00:21:08 +00:00
this.markers[name] = {
name: name,
start: start,
stop: start + duration,
volume: volume,
duration: duration,
durationMS: duration * 1000,
loop: loop
};
},
2013-11-28 15:57:09 +00:00
/**
* Removes a marker from the sound.
* @method Phaser.Sound#removeMarker
* @param {string} name - The key of the marker to remove.
*/
2013-10-03 00:21:08 +00:00
removeMarker: function (name) {
delete this.markers[name];
},
2015-03-23 23:46:30 +00:00
/**
* Called automatically by the AudioContext when the sound stops playing.
* Doesn't get called if the sound is set to loop or is a section of an Audio Sprite.
*
* @method Phaser.Sound#onEndedHandler
* @protected
*/
onEndedHandler: function () {
2015-10-15 11:06:38 +00:00
this._sound.onended = null;
2015-03-23 23:46:30 +00:00
this.isPlaying = false;
2016-02-08 17:01:36 +00:00
this.currentTime = this.durationMS;
2015-03-23 23:46:30 +00:00
this.stop();
},
2013-11-28 15:57:09 +00:00
/**
* Called automatically by Phaser.SoundManager.
* @method Phaser.Sound#update
2013-10-03 00:21:08 +00:00
* @protected
2013-11-28 15:57:09 +00:00
*/
2013-10-03 00:21:08 +00:00
update: function () {
2014-10-22 20:49:44 +00:00
2015-07-29 14:01:04 +00:00
if (!this.game.cache.checkSoundKey(this.key))
{
this.destroy();
return;
}
2015-03-23 23:46:30 +00:00
if (this.isDecoded & & !this._onDecodedEventDispatched)
2014-09-09 14:36:56 +00:00
{
2014-07-10 19:31:11 +00:00
this.onDecoded.dispatch(this);
2014-09-09 14:36:56 +00:00
this._onDecodedEventDispatched = true;
2014-07-10 19:31:11 +00:00
}
2013-10-03 00:21:08 +00:00
2015-03-23 23:46:30 +00:00
if (this.pendingPlayback & & this.game.cache.isSoundReady(this.key))
2013-10-03 00:21:08 +00:00
{
this.pendingPlayback = false;
this.play(this._tempMarker, this._tempPosition, this._tempVolume, this._tempLoop);
}
if (this.isPlaying)
{
2014-11-15 20:01:46 +00:00
this.currentTime = this.game.time.time - this.startTime;
2013-10-03 00:21:08 +00:00
if (this.currentTime >= this.durationMS)
{
if (this.usingWebAudio)
{
if (this.loop)
{
// won't work with markers, needs to reset the position
this.onLoop.dispatch(this);
2016-05-19 11:36:51 +00:00
// Gets reset by the play function
this.isPlaying = false;
2013-11-28 15:57:09 +00:00
if (this.currentMarker === '')
2013-10-03 00:21:08 +00:00
{
this.currentTime = 0;
2014-11-15 20:01:46 +00:00
this.startTime = this.game.time.time;
2016-06-09 16:13:31 +00:00
this.isPlaying = true; // play not called again in this case
2013-10-03 00:21:08 +00:00
}
else
{
2014-03-14 06:36:05 +00:00
this.onMarkerComplete.dispatch(this.currentMarker, this);
2013-10-03 00:21:08 +00:00
this.play(this.currentMarker, 0, this.volume, true, true);
}
}
else
{
2015-03-23 23:46:30 +00:00
// Stop if we're using an audio marker, otherwise we let onended handle it
if (this.currentMarker !== '')
{
this.stop();
}
2013-10-03 00:21:08 +00:00
}
}
else
{
if (this.loop)
{
this.onLoop.dispatch(this);
2016-05-19 11:36:51 +00:00
if (this.currentMarker === '')
{
this.currentTime = 0;
this.startTime = this.game.time.time;
}
// Gets reset by the play function
this.isPlaying = false;
2013-10-03 00:21:08 +00:00
this.play(this.currentMarker, 0, this.volume, true, true);
}
else
{
this.stop();
}
}
}
}
},
2015-03-23 23:46:30 +00:00
/**
* Loops this entire sound. If you need to loop a section of it then use Sound.play and the marker and loop parameters.
*
* @method Phaser.Sound#loopFull
* @param {number} [volume=1] - Volume of the sound you want to play. If none is given it will use the volume given to the Sound when it was created (which defaults to 1 if none was specified).
* @return {Phaser.Sound} This sound instance.
*/
loopFull: function (volume) {
this.play(null, 0, volume, true);
},
2013-11-28 15:57:09 +00:00
/**
2013-10-03 00:21:08 +00:00
* Play this sound, or a marked section of it.
2015-03-23 23:46:30 +00:00
*
2013-10-03 00:21:08 +00:00
* @method Phaser.Sound#play
* @param {string} [marker=''] - If you want to play a marker then give the key here, otherwise leave blank to play the full sound.
* @param {number} [position=0] - The starting position to play the sound from - this is ignored if you provide a marker.
2013-11-28 15:57:09 +00:00
* @param {number} [volume=1] - Volume of the sound you want to play. If none is given it will use the volume given to the Sound when it was created (which defaults to 1 if none was specified).
2015-03-23 23:46:30 +00:00
* @param {boolean} [loop=false] - Loop when finished playing? If not using a marker / audio sprite the looping will be done via the WebAudio loop property, otherwise it's time based.
2013-10-03 00:21:08 +00:00
* @param {boolean} [forceRestart=true] - If the sound is already playing you can set forceRestart to restart it from the beginning.
2013-11-28 15:57:09 +00:00
* @return {Phaser.Sound} This sound instance.
2013-10-03 00:21:08 +00:00
*/
play: function (marker, position, volume, loop, forceRestart) {
2015-07-22 14:31:30 +00:00
if (marker === undefined || marker === false || marker === null) { marker = ''; }
if (forceRestart === undefined) { forceRestart = true; }
2015-03-23 23:46:30 +00:00
if (this.isPlaying & & !this.allowMultiple & & !forceRestart & & !this.override)
2013-10-03 00:21:08 +00:00
{
// Use Restart instead
2014-05-20 09:12:48 +00:00
return this;
2013-10-03 00:21:08 +00:00
}
2015-03-23 23:46:30 +00:00
if (this._sound & & this.isPlaying & & !this.allowMultiple & & (this.override || forceRestart))
2013-10-03 00:21:08 +00:00
{
if (this.usingWebAudio)
{
2015-07-22 14:31:30 +00:00
if (this._sound.stop === undefined)
2013-10-03 00:21:08 +00:00
{
this._sound.noteOff(0);
}
else
{
2015-01-06 06:57:25 +00:00
try {
this._sound.stop(0);
}
catch (e) {
}
2013-10-03 00:21:08 +00:00
}
2016-02-08 17:01:36 +00:00
if (this.externalNode)
{
this._sound.disconnect(this.externalNode);
}
else
{
this._sound.disconnect(this.gainNode);
}
2013-10-03 00:21:08 +00:00
}
else if (this.usingAudioTag)
{
this._sound.pause();
this._sound.currentTime = 0;
}
}
2015-03-23 23:46:30 +00:00
if (marker === '' & & Object.keys(this.markers).length > 0)
2015-01-06 06:57:25 +00:00
{
// If they didn't specify a marker but this is an audio sprite,
// we should never play the entire thing
return this;
}
2013-10-03 00:21:08 +00:00
if (marker !== '')
{
2015-01-06 06:57:25 +00:00
this.currentMarker = marker;
2013-10-03 00:21:08 +00:00
if (this.markers[marker])
{
2014-03-24 12:41:45 +00:00
// Playing a marker? Then we default to the marker values
2013-10-03 00:21:08 +00:00
this.position = this.markers[marker].start;
this.volume = this.markers[marker].volume;
this.loop = this.markers[marker].loop;
this.duration = this.markers[marker].duration;
this.durationMS = this.markers[marker].durationMS;
2014-03-24 12:41:45 +00:00
if (typeof volume !== 'undefined')
{
this.volume = volume;
}
if (typeof loop !== 'undefined')
{
this.loop = loop;
}
2013-10-03 00:21:08 +00:00
this._tempMarker = marker;
this._tempPosition = this.position;
this._tempVolume = this.volume;
this._tempLoop = this.loop;
}
else
{
2015-03-23 23:46:30 +00:00
// console.warn("Phaser.Sound.play: audio marker " + marker + " doesn't exist");
2014-05-20 09:12:48 +00:00
return this;
2013-10-03 00:21:08 +00:00
}
}
else
{
2014-03-24 12:41:45 +00:00
position = position || 0;
2015-07-22 14:31:30 +00:00
if (volume === undefined) { volume = this._volume; }
if (loop === undefined) { loop = this.loop; }
2013-10-03 00:21:08 +00:00
2016-04-22 14:15:28 +00:00
this.position = Math.max(0, position);
2013-10-03 00:21:08 +00:00
this.volume = volume;
this.loop = loop;
this.duration = 0;
this.durationMS = 0;
this._tempMarker = marker;
this._tempPosition = position;
this._tempVolume = volume;
this._tempLoop = loop;
}
if (this.usingWebAudio)
{
// Does the sound need decoding?
if (this.game.cache.isSoundDecoded(this.key))
{
this._sound = this.context.createBufferSource();
2014-03-28 01:42:49 +00:00
2013-11-28 15:57:09 +00:00
if (this.externalNode)
{
2014-07-10 19:31:11 +00:00
this._sound.connect(this.externalNode);
2013-11-28 15:57:09 +00:00
}
else
{
this._sound.connect(this.gainNode);
}
2015-07-22 14:31:30 +00:00
this._buffer = this.game.cache.getSoundData(this.key);
this._sound.buffer = this._buffer;
2015-03-23 23:46:30 +00:00
if (this.loop & & marker === '')
{
this._sound.loop = true;
}
if (!this.loop & & marker === '')
{
this._sound.onended = this.onEndedHandler.bind(this);
}
2013-10-03 00:21:08 +00:00
this.totalDuration = this._sound.buffer.duration;
2013-11-28 15:57:09 +00:00
if (this.duration === 0)
2013-10-03 00:21:08 +00:00
{
this.duration = this.totalDuration;
2015-03-23 23:46:30 +00:00
this.durationMS = Math.ceil(this.totalDuration * 1000);
2013-10-03 00:21:08 +00:00
}
// Useful to cache this somewhere perhaps?
2015-07-22 14:31:30 +00:00
if (this._sound.start === undefined)
2013-10-03 00:21:08 +00:00
{
this._sound.noteGrainOn(0, this.position, this.duration);
2013-11-28 15:57:09 +00:00
}
else
{
2015-03-23 23:46:30 +00:00
if (this.loop & & marker === '')
{
2015-07-22 14:31:30 +00:00
this._sound.start(0, 0);
2015-03-23 23:46:30 +00:00
}
else
{
this._sound.start(0, this.position, this.duration);
}
2013-10-03 00:21:08 +00:00
}
this.isPlaying = true;
2014-11-15 20:01:46 +00:00
this.startTime = this.game.time.time;
2013-10-03 00:21:08 +00:00
this.currentTime = 0;
this.stopTime = this.startTime + this.durationMS;
this.onPlay.dispatch(this);
2013-11-28 15:57:09 +00:00
}
else
{
2013-10-03 00:21:08 +00:00
this.pendingPlayback = true;
2015-03-23 23:46:30 +00:00
if (this.game.cache.getSound(this.key) & & this.game.cache.getSound(this.key).isDecoding === false)
2013-10-03 00:21:08 +00:00
{
this.game.sound.decode(this.key, this);
}
}
}
else
{
2015-03-23 23:46:30 +00:00
if (this.game.cache.getSound(this.key) & & this.game.cache.getSound(this.key).locked)
2013-10-03 00:21:08 +00:00
{
this.game.cache.reloadSound(this.key);
this.pendingPlayback = true;
}
else
{
2015-03-23 23:46:30 +00:00
if (this._sound & & (this.game.device.cocoonJS || this._sound.readyState === 4))
2013-10-03 00:21:08 +00:00
{
this._sound.play();
// This doesn't become available until you call play(), wonderful ...
this.totalDuration = this._sound.duration;
2013-11-28 15:57:09 +00:00
if (this.duration === 0)
2013-10-03 00:21:08 +00:00
{
this.duration = this.totalDuration;
this.durationMS = this.totalDuration * 1000;
}
this._sound.currentTime = this.position;
this._sound.muted = this._muted;
2014-03-28 01:42:49 +00:00
2016-04-22 14:15:28 +00:00
if (this._muted || this.game.sound.mute)
2013-10-03 00:21:08 +00:00
{
this._sound.volume = 0;
}
else
{
this._sound.volume = this._volume;
}
this.isPlaying = true;
2014-11-15 20:01:46 +00:00
this.startTime = this.game.time.time;
2013-10-03 00:21:08 +00:00
this.currentTime = 0;
this.stopTime = this.startTime + this.durationMS;
2016-05-19 11:36:51 +00:00
2013-10-03 00:21:08 +00:00
this.onPlay.dispatch(this);
}
else
{
this.pendingPlayback = true;
}
}
}
2014-05-20 09:12:48 +00:00
return this;
2014-10-22 20:49:44 +00:00
2013-10-03 00:21:08 +00:00
},
/**
* Restart the sound, or a marked section of it.
2014-04-29 14:39:02 +00:00
*
2013-10-03 00:21:08 +00:00
* @method Phaser.Sound#restart
* @param {string} [marker=''] - If you want to play a marker then give the key here, otherwise leave blank to play the full sound.
* @param {number} [position=0] - The starting position to play the sound from - this is ignored if you provide a marker.
* @param {number} [volume=1] - Volume of the sound you want to play.
* @param {boolean} [loop=false] - Loop when it finished playing?
*/
restart: function (marker, position, volume, loop) {
2013-11-28 15:57:09 +00:00
marker = marker || '';
position = position || 0;
volume = volume || 1;
2015-07-22 14:31:30 +00:00
if (loop === undefined) { loop = false; }
2013-10-03 00:21:08 +00:00
this.play(marker, position, volume, loop, true);
},
/**
2014-04-29 14:39:02 +00:00
* Pauses the sound.
*
2013-10-03 00:21:08 +00:00
* @method Phaser.Sound#pause
*/
pause: function () {
2015-03-23 23:46:30 +00:00
if (this.isPlaying & & this._sound)
2013-10-03 00:21:08 +00:00
{
this.paused = true;
2013-10-25 15:54:40 +00:00
this.pausedPosition = this.currentTime;
2014-11-15 20:01:46 +00:00
this.pausedTime = this.game.time.time;
2016-05-19 11:36:51 +00:00
this._tempPause = this._sound.currentTime;
2013-10-03 00:21:08 +00:00
this.onPause.dispatch(this);
2014-07-10 19:31:11 +00:00
this.stop();
2013-10-03 00:21:08 +00:00
}
},
2013-10-25 15:54:40 +00:00
2013-10-03 00:21:08 +00:00
/**
2014-04-29 14:39:02 +00:00
* Resumes the sound.
*
2013-10-03 00:21:08 +00:00
* @method Phaser.Sound#resume
*/
resume: function () {
2015-03-23 23:46:30 +00:00
if (this.paused & & this._sound)
2013-10-03 00:21:08 +00:00
{
if (this.usingWebAudio)
{
2016-04-22 14:15:28 +00:00
var p = Math.max(0, this.position + (this.pausedPosition / 1000));
2013-10-25 15:54:40 +00:00
this._sound = this.context.createBufferSource();
this._sound.buffer = this._buffer;
2014-02-05 06:29:17 +00:00
if (this.externalNode)
{
2014-07-10 19:31:11 +00:00
this._sound.connect(this.externalNode);
2014-02-05 06:29:17 +00:00
}
else
{
this._sound.connect(this.gainNode);
}
if (this.loop)
{
this._sound.loop = true;
}
2013-10-25 15:54:40 +00:00
2015-03-23 23:46:30 +00:00
if (!this.loop & & this.currentMarker === '')
{
this._sound.onended = this.onEndedHandler.bind(this);
}
2015-03-26 02:38:46 +00:00
var duration = this.duration - (this.pausedPosition / 1000);
2015-07-22 14:31:30 +00:00
if (this._sound.start === undefined)
2013-10-03 00:21:08 +00:00
{
2015-03-26 02:38:46 +00:00
this._sound.noteGrainOn(0, p, duration);
2013-10-03 00:21:08 +00:00
//this._sound.noteOn(0); // the zero is vitally important, crashes iOS6 without it
2013-11-28 15:57:09 +00:00
}
else
{
2015-07-22 14:31:30 +00:00
if (this.loop & & this.game.device.chrome)
{
// Handle chrome bug: https://code.google.com/p/chromium/issues/detail?id=457099
if (this.game.device.chromeVersion === 42)
{
this._sound.start(0);
}
else
{
this._sound.start(0, p);
}
}
else
{
this._sound.start(0, p, duration);
}
2013-10-03 00:21:08 +00:00
}
}
else
{
2016-05-19 11:36:51 +00:00
this._sound.currentTime = this._tempPause;
2013-10-03 00:21:08 +00:00
this._sound.play();
}
this.isPlaying = true;
this.paused = false;
2014-11-15 20:01:46 +00:00
this.startTime += (this.game.time.time - this.pausedTime);
2013-10-03 00:21:08 +00:00
this.onResume.dispatch(this);
}
},
2013-11-28 15:57:09 +00:00
/**
2013-10-03 00:21:08 +00:00
* Stop playing this sound.
2014-04-10 22:13:43 +00:00
*
2013-10-03 00:21:08 +00:00
* @method Phaser.Sound#stop
*/
stop: function () {
2015-03-23 23:46:30 +00:00
if (this.isPlaying & & this._sound)
2013-10-03 00:21:08 +00:00
{
if (this.usingWebAudio)
{
2015-07-22 14:31:30 +00:00
if (this._sound.stop === undefined)
2013-10-03 00:21:08 +00:00
{
this._sound.noteOff(0);
}
else
{
2014-05-20 09:12:48 +00:00
try {
this._sound.stop(0);
}
catch (e)
{
// Thanks Android 4.4
}
2013-10-03 00:21:08 +00:00
}
2016-02-08 17:01:36 +00:00
if (this.externalNode)
{
this._sound.disconnect(this.externalNode);
}
else
{
this._sound.disconnect(this.gainNode);
}
2013-10-03 00:21:08 +00:00
}
else if (this.usingAudioTag)
{
this._sound.pause();
this._sound.currentTime = 0;
}
}
2015-03-23 23:46:30 +00:00
this.pendingPlayback = false;
2013-10-03 00:21:08 +00:00
this.isPlaying = false;
2014-03-28 01:42:49 +00:00
2016-02-08 17:01:36 +00:00
if (!this.paused)
2014-03-14 06:36:05 +00:00
{
2016-02-08 17:01:36 +00:00
var prevMarker = this.currentMarker;
2014-03-14 06:36:05 +00:00
2016-02-08 17:01:36 +00:00
if (this.currentMarker !== '')
{
this.onMarkerComplete.dispatch(this.currentMarker, this);
}
2014-07-10 19:31:11 +00:00
2016-02-08 17:01:36 +00:00
this.currentMarker = '';
if (this.fadeTween !== null)
{
this.fadeTween.stop();
}
2015-03-23 23:46:30 +00:00
2014-07-10 19:31:11 +00:00
this.onStop.dispatch(this, prevMarker);
}
2013-10-03 00:21:08 +00:00
2014-04-10 22:13:43 +00:00
},
2014-10-09 15:12:53 +00:00
/**
2016-04-22 14:15:28 +00:00
* Starts this sound playing (or restarts it if already doing so) and sets the volume to zero.
* Then increases the volume from 0 to 1 over the duration specified.
*
* At the end of the fade Sound.onFadeComplete is dispatched with this Sound object as the first parameter,
* and the final volume (1) as the second parameter.
*
* @method Phaser.Sound#fadeIn
* @param {number} [duration=1000] - The time in milliseconds over which the Sound should fade in.
* @param {boolean} [loop=false] - Should the Sound be set to loop? Note that this doesn't cause the fade to repeat.
* @param {string} [marker=(current marker)] - The marker to start at; defaults to the current (last played) marker. To start playing from the beginning specify specify a marker of `''`.
*/
2015-03-23 23:46:30 +00:00
fadeIn: function (duration, loop, marker) {
2014-10-09 15:12:53 +00:00
2015-07-22 14:31:30 +00:00
if (loop === undefined) { loop = false; }
if (marker === undefined) { marker = this.currentMarker; }
2014-10-09 15:12:53 +00:00
if (this.paused)
{
return;
}
2015-03-23 23:46:30 +00:00
this.play(marker, 0, 0, loop);
2014-10-09 15:12:53 +00:00
2014-10-22 20:49:44 +00:00
this.fadeTo(duration, 1);
2014-10-09 15:12:53 +00:00
},
2015-03-23 23:46:30 +00:00
2014-10-09 15:12:53 +00:00
/**
2016-04-22 14:15:28 +00:00
* Decreases the volume of this Sound from its current value to 0 over the duration specified.
* At the end of the fade Sound.onFadeComplete is dispatched with this Sound object as the first parameter,
* and the final volume (0) as the second parameter.
*
* @method Phaser.Sound#fadeOut
* @param {number} [duration=1000] - The time in milliseconds over which the Sound should fade out.
*/
2014-10-09 15:12:53 +00:00
fadeOut: function (duration) {
2014-10-22 20:49:44 +00:00
this.fadeTo(duration, 0);
},
/**
2016-04-22 14:15:28 +00:00
* Fades the volume of this Sound from its current value to the given volume over the duration specified.
* At the end of the fade Sound.onFadeComplete is dispatched with this Sound object as the first parameter,
* and the final volume (volume) as the second parameter.
*
* @method Phaser.Sound#fadeTo
* @param {number} [duration=1000] - The time in milliseconds during which the Sound should fade out.
* @param {number} [volume] - The volume which the Sound should fade to. This is a value between 0 and 1.
*/
2014-10-22 20:49:44 +00:00
fadeTo: function (duration, volume) {
if (!this.isPlaying || this.paused || volume === this.volume)
{
return;
}
2015-07-22 14:31:30 +00:00
if (duration === undefined) { duration = 1000; }
2014-10-09 15:12:53 +00:00
2015-07-22 14:31:30 +00:00
if (volume === undefined)
2014-10-09 15:12:53 +00:00
{
2014-10-22 20:49:44 +00:00
console.warn("Phaser.Sound.fadeTo: No Volume Specified.");
2014-10-09 15:12:53 +00:00
return;
}
2015-03-23 23:46:30 +00:00
this.fadeTween = this.game.add.tween(this).to( { volume: volume }, duration, Phaser.Easing.Linear.None, true);
2014-10-09 15:12:53 +00:00
2015-03-23 23:46:30 +00:00
this.fadeTween.onComplete.add(this.fadeComplete, this);
2014-10-09 15:12:53 +00:00
},
/**
2016-04-22 14:15:28 +00:00
* Internal handler for Sound.fadeIn, Sound.fadeOut and Sound.fadeTo.
*
* @method Phaser.Sound#fadeComplete
* @private
*/
2014-10-09 15:12:53 +00:00
fadeComplete: function () {
this.onFadeComplete.dispatch(this, this.volume);
if (this.volume === 0)
{
this.stop();
}
},
2016-04-22 14:15:28 +00:00
/**
* Called automatically by SoundManager.volume.
*
* Sets the volume of AudioTag Sounds as a percentage of the Global Volume.
*
* You should not normally call this directly.
*
* @method Phaser.Sound#updateGlobalVolume
* @protected
* @param {float} globalVolume - The global SoundManager volume.
*/
updateGlobalVolume: function (globalVolume) {
// this._volume is the % of the global volume this sound should be played at
if (this.usingAudioTag & & this._sound)
{
this._sound.volume = globalVolume * this._volume;
}
},
2014-04-10 22:13:43 +00:00
/**
* Destroys this sound and all associated events and removes it from the SoundManager.
*
* @method Phaser.Sound#destroy
* @param {boolean} [remove=true] - If true this Sound is automatically removed from the SoundManager.
*/
destroy: function (remove) {
2015-07-22 14:31:30 +00:00
if (remove === undefined) { remove = true; }
2014-04-10 22:13:43 +00:00
this.stop();
if (remove)
{
this.game.sound.remove(this);
}
2014-07-10 19:31:11 +00:00
else
{
this.markers = {};
this.context = null;
this._buffer = null;
this.externalNode = null;
this.onDecoded.dispose();
this.onPlay.dispose();
this.onPause.dispose();
this.onResume.dispose();
this.onLoop.dispose();
this.onStop.dispose();
this.onMute.dispose();
this.onMarkerComplete.dispose();
}
2014-04-10 22:13:43 +00:00
2013-10-03 00:21:08 +00:00
}
};
2014-02-05 06:29:17 +00:00
Phaser.Sound.prototype.constructor = Phaser.Sound;
2013-10-03 00:21:08 +00:00
/**
* @name Phaser.Sound#isDecoding
* @property {boolean} isDecoding - Returns true if the sound file is still decoding.
* @readonly
*/
Object.defineProperty(Phaser.Sound.prototype, "isDecoding", {
get: function () {
return this.game.cache.getSound(this.key).isDecoding;
}
});
/**
* @name Phaser.Sound#isDecoded
* @property {boolean} isDecoded - Returns true if the sound file has decoded.
* @readonly
*/
Object.defineProperty(Phaser.Sound.prototype, "isDecoded", {
get: function () {
return this.game.cache.isSoundDecoded(this.key);
}
});
/**
* @name Phaser.Sound#mute
* @property {boolean} mute - Gets or sets the muted state of this sound.
*/
Object.defineProperty(Phaser.Sound.prototype, "mute", {
2014-03-28 01:42:49 +00:00
2013-10-03 00:21:08 +00:00
get: function () {
2014-04-29 14:39:02 +00:00
return (this._muted || this.game.sound.mute);
2013-10-03 00:21:08 +00:00
},
2014-03-28 01:42:49 +00:00
2013-10-03 00:21:08 +00:00
set: function (value) {
2015-07-22 14:31:30 +00:00
value = value || false;
if (value === this._muted)
{
return;
}
2013-10-03 00:21:08 +00:00
if (value)
{
this._muted = true;
2015-07-22 14:31:30 +00:00
this._muteVolume = this._tempVolume;
2013-10-03 00:21:08 +00:00
if (this.usingWebAudio)
{
this.gainNode.gain.value = 0;
}
2015-03-23 23:46:30 +00:00
else if (this.usingAudioTag & & this._sound)
2013-10-03 00:21:08 +00:00
{
this._sound.volume = 0;
}
}
else
{
this._muted = false;
if (this.usingWebAudio)
{
this.gainNode.gain.value = this._muteVolume;
}
2015-03-23 23:46:30 +00:00
else if (this.usingAudioTag & & this._sound)
2013-10-03 00:21:08 +00:00
{
this._sound.volume = this._muteVolume;
}
}
this.onMute.dispatch(this);
}
});
/**
* @name Phaser.Sound#volume
* @property {number} volume - Gets or sets the volume of this sound, a value between 0 and 1.
* @readonly
*/
Object.defineProperty(Phaser.Sound.prototype, "volume", {
get: function () {
return this._volume;
},
set: function (value) {
2015-07-22 14:31:30 +00:00
// Causes an Index size error in Firefox if you don't clamp the value
if (this.game.device.firefox & & this.usingAudioTag)
{
value = this.game.math.clamp(value, 0, 1);
}
if (this._muted)
{
this._muteVolume = value;
return;
}
this._tempVolume = value;
this._volume = value;
2013-10-03 00:21:08 +00:00
if (this.usingWebAudio)
{
this.gainNode.gain.value = value;
}
2015-03-23 23:46:30 +00:00
else if (this.usingAudioTag & & this._sound)
2013-10-03 00:21:08 +00:00
{
2015-07-22 14:31:30 +00:00
this._sound.volume = value;
2013-10-03 00:21:08 +00:00
}
}
});
< / pre >
< / article >
< / section >
< / div >
< div class = "clearfix" > < / div >
< footer >
< span class = "copyright" >
2016-04-22 14:15:28 +00:00
Phaser Copyright © 2012-2016 Photon Storm Ltd.
2013-10-03 00:21:08 +00:00
< / span >
< br / >
< span class = "jsdoc-message" >
2016-06-17 11:46:47 +00:00
Documentation generated by < a href = "https://github.com/jsdoc3/jsdoc" > JSDoc 3.3.3< / a >
on Fri Jun 17 2016 12:45:29 GMT+0100 (BST) using the < a href = "https://github.com/terryweiss/docstrap" > DocStrap template< / a > .
2013-10-03 00:21:08 +00:00
< / span >
< / footer >
< / div >
< br clear = "both" >
< / div >
< / div >
< script src = "scripts/sunlight.js" > < / script >
< script src = "scripts/sunlight.javascript.js" > < / script >
< script src = "scripts/sunlight-plugin.doclinks.js" > < / script >
< script src = "scripts/sunlight-plugin.linenumbers.js" > < / script >
< script src = "scripts/sunlight-plugin.menu.js" > < / script >
< script src = "scripts/jquery.min.js" > < / script >
< script src = "scripts/jquery.scrollTo.js" > < / script >
< script src = "scripts/jquery.localScroll.js" > < / script >
< script src = "scripts/bootstrap-dropdown.js" > < / script >
< script src = "scripts/toc.js" > < / script >
< script > Sunlight . highlightAll ( { lineNumbers : true , showMenu : true , enableDoclinks : true } ) ; < / script >
< script >
$( function () {
$( "#toc" ).toc( {
2014-04-10 22:13:43 +00:00
anchorName : function(i, heading, prefix) {
2014-03-14 06:36:05 +00:00
return $(heading).attr("id") || ( prefix + i );
},
2013-10-03 00:21:08 +00:00
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
< / script >
< / body >
< / html >