2013-10-25 15:54:40 +00:00
<!DOCTYPE html>
< html lang = "en" >
< head >
< meta charset = "utf-8" >
< title > Phaser Class: Arcade< / title >
<!-- [if lt IE 9]>
< script src = "//html5shiv.googlecode.com/svn/trunk/html5.js" > < / script >
<![endif]-->
< link type = "text/css" rel = "stylesheet" href = "styles/sunlight.default.css" >
< link type = "text/css" rel = "stylesheet" href = "styles/site.cerulean.css" >
< / head >
< body >
< div class = "container-fluid" >
< div class = "navbar navbar-fixed-top navbar-inverse" >
< div class = "navbar-inner" >
< a class = "brand" href = "index.html" > Phaser< / a >
< ul class = "nav" >
< li class = "dropdown" >
< a href = "namespaces.list.html" class = "dropdown-toggle" data-toggle = "dropdown" > Namespaces< b
class="caret">< / b > < / a >
< ul class = "dropdown-menu " >
< li >
< a href = "Phaser.html" > Phaser< / a >
< / li >
< / 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 " >
< li >
< a href = "Phaser.Animation.html" > Animation< / a >
< / li >
< li >
< a href = "Phaser.AnimationManager.html" > AnimationManager< / a >
< / li >
< li >
< a href = "Phaser.AnimationParser.html" > AnimationParser< / a >
< / li >
2013-11-28 15:57:09 +00:00
< li >
< a href = "Phaser.BitmapData.html" > BitmapData< / a >
< / li >
2013-10-25 15:54:40 +00:00
< li >
< a href = "Phaser.BitmapText.html" > BitmapText< / a >
< / li >
< li >
< a href = "Phaser.Button.html" > Button< / a >
< / li >
< li >
< a href = "Phaser.Cache.html" > Cache< / a >
< / li >
< li >
< a href = "Phaser.Camera.html" > Camera< / a >
< / li >
< li >
< a href = "Phaser.Canvas.html" > Canvas< / a >
< / li >
< li >
< a href = "Phaser.Circle.html" > Circle< / a >
< / li >
< li >
< a href = "Phaser.Color.html" > Color< / a >
< / li >
< li >
< a href = "Phaser.Device.html" > Device< / a >
< / li >
< li >
< a href = "Phaser.Easing.html" > Easing< / a >
< / li >
< li >
< a href = "Phaser.Easing.Back.html" > Back< / a >
< / li >
< li >
< a href = "Phaser.Easing.Bounce.html" > Bounce< / a >
< / li >
< li >
< a href = "Phaser.Easing.Circular.html" > Circular< / a >
< / li >
< li >
< a href = "Phaser.Easing.Cubic.html" > Cubic< / a >
< / li >
< li >
< a href = "Phaser.Easing.Elastic.html" > Elastic< / a >
< / li >
< li >
< a href = "Phaser.Easing.Exponential.html" > Exponential< / a >
< / li >
< li >
< a href = "Phaser.Easing.Linear.html" > Linear< / a >
< / li >
< li >
< a href = "Phaser.Easing.Quadratic.html" > Quadratic< / a >
< / li >
< li >
< a href = "Phaser.Easing.Quartic.html" > Quartic< / a >
< / li >
< li >
< a href = "Phaser.Easing.Quintic.html" > Quintic< / a >
< / li >
< li >
< a href = "Phaser.Easing.Sinusoidal.html" > Sinusoidal< / a >
< / li >
2014-02-18 03:01:51 +00:00
< li >
< a href = "Phaser.Ellipse.html" > Ellipse< / a >
< / li >
2013-10-25 15:54:40 +00:00
< li >
< a href = "Phaser.Events.html" > Events< / a >
< / li >
2013-11-28 15:57:09 +00:00
< li >
< a href = "Phaser.Filter.html" > Filter< / a >
< / li >
2013-10-25 15:54:40 +00:00
< li >
< a href = "Phaser.Frame.html" > Frame< / a >
< / li >
< li >
< a href = "Phaser.FrameData.html" > FrameData< / a >
< / li >
< li >
< a href = "Phaser.Game.html" > Game< / a >
< / li >
2014-02-21 15:37:26 +00:00
< li >
< a href = "Phaser.GameObjectCreator.html" > GameObjectCreator< / a >
< / li >
2013-10-25 15:54:40 +00:00
< li >
< a href = "Phaser.GameObjectFactory.html" > GameObjectFactory< / a >
< / li >
2014-02-05 06:29:17 +00:00
< li >
< a href = "Phaser.Gamepad.html" > Gamepad< / a >
< / li >
< li >
< a href = "Phaser.GamepadButton.html" > GamepadButton< / a >
< / li >
2013-10-25 15:54:40 +00:00
< li >
< a href = "Phaser.Graphics.html" > Graphics< / a >
< / li >
< li >
< a href = "Phaser.Group.html" > Group< / a >
< / li >
2014-02-08 07:24:22 +00:00
< li >
< a href = "Phaser.Image.html" > Image< / a >
< / li >
2013-10-25 15:54:40 +00:00
< li >
< a href = "Phaser.Input.html" > Input< / a >
< / li >
< li >
< a href = "Phaser.InputHandler.html" > InputHandler< / a >
< / li >
< li >
< a href = "Phaser.Key.html" > Key< / a >
< / li >
< li >
< a href = "Phaser.Keyboard.html" > Keyboard< / a >
< / li >
2014-02-05 06:29:17 +00:00
< li >
< a href = "Phaser.Line.html" > Line< / a >
< / li >
2013-10-25 15:54:40 +00:00
< li >
< a href = "Phaser.LinkedList.html" > LinkedList< / a >
< / li >
< li >
< a href = "Phaser.Loader.html" > Loader< / a >
< / li >
< li >
< a href = "Phaser.LoaderParser.html" > LoaderParser< / a >
< / li >
< li >
< a href = "Phaser.Math.html" > Math< / a >
< / li >
< li >
< a href = "Phaser.Mouse.html" > Mouse< / a >
< / li >
< li >
< a href = "Phaser.MSPointer.html" > MSPointer< / a >
< / li >
< li >
< a href = "Phaser.Net.html" > Net< / a >
< / li >
< li >
< a href = "Phaser.Particles.html" > Particles< / a >
< / li >
< li >
< a href = "Phaser.Particles.Arcade.Emitter.html" > Emitter< / a >
< / li >
< li >
< a href = "Phaser.Physics.html" > Physics< / a >
< / li >
< li >
< a href = "Phaser.Physics.Arcade.html" > Arcade< / a >
< / li >
2014-02-21 15:37:26 +00:00
< li >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.Arcade.Body.html" > Body< / a >
< / li >
< li >
< a href = "Phaser.Physics.Ninja.html" > Ninja< / a >
< / li >
< li >
< a href = "Phaser.Physics.Ninja.AABB.html" > AABB< / a >
< / li >
< li >
< a href = "Phaser.Physics.Ninja.Body.html" > Body< / a >
< / li >
< li >
< a href = "Phaser.Physics.Ninja.Circle.html" > Circle< / a >
< / li >
< li >
< a href = "Phaser.Physics.Ninja.Tile.html" > Tile< / a >
< / li >
< li >
< a href = "Phaser.Physics.P2.html" > P2< / a >
< / li >
< li >
< a href = "Phaser.Physics.P2.Body.html" > Body< / a >
< / li >
< li >
< a href = "Phaser.Physics.P2.BodyDebug.html" > BodyDebug< / a >
< / li >
< li >
< a href = "Phaser.Physics.P2.CollisionGroup.html" > CollisionGroup< / a >
< / li >
< li >
< a href = "Phaser.Physics.P2.ContactMaterial.html" > ContactMaterial< / a >
< / li >
< li >
< a href = "Phaser.Physics.P2.DistanceConstraint.html" > DistanceConstraint< / a >
2014-02-21 15:37:26 +00:00
< / li >
< li >
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 >
< li >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.InversePointProxy.html" > InversePointProxy< / a >
2014-02-21 15:37:26 +00:00
< / li >
< li >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.LockConstraint.html" > LockConstraint< / a >
2014-02-21 15:37:26 +00:00
< / li >
< li >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.Material.html" > Material< / a >
2014-02-21 15:37:26 +00:00
< / li >
< li >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.PointProxy.html" > PointProxy< / a >
2014-02-21 15:37:26 +00:00
< / li >
< li >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.PrismaticConstraint.html" > PrismaticConstraint< / a >
2014-02-21 15:37:26 +00:00
< / li >
< li >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.RevoluteConstraint.html" > RevoluteConstraint< / a >
< / li >
< li >
< a href = "Phaser.Physics.P2.Spring.html" > Spring< / a >
2014-02-21 15:37:26 +00:00
< / li >
2013-10-25 15:54:40 +00:00
< li >
< a href = "Phaser.Plugin.html" > Plugin< / a >
< / li >
< li >
< a href = "Phaser.PluginManager.html" > PluginManager< / a >
< / li >
< li >
< a href = "Phaser.Point.html" > Point< / a >
< / li >
< li >
< a href = "Phaser.Pointer.html" > Pointer< / a >
< / li >
2013-11-07 06:10:15 +00:00
< li >
< a href = "Phaser.Polygon.html" > Polygon< / a >
< / li >
2014-03-14 06:36:05 +00:00
< li >
< a href = "Phaser.QuadTree.html" > QuadTree< / a >
< / li >
2013-10-25 15:54:40 +00:00
< li >
< a href = "Phaser.RandomDataGenerator.html" > RandomDataGenerator< / a >
< / li >
< li >
< a href = "Phaser.Rectangle.html" > Rectangle< / a >
< / li >
< li >
< a href = "Phaser.RenderTexture.html" > RenderTexture< / a >
< / li >
< li >
< a href = "Phaser.RequestAnimationFrame.html" > RequestAnimationFrame< / a >
< / li >
2014-03-14 06:36:05 +00:00
< li >
< a href = "Phaser.RetroFont.html" > RetroFont< / a >
< / li >
< li >
< a href = "Phaser.ScaleManager.html" > ScaleManager< / a >
< / li >
2013-10-25 15:54:40 +00:00
< li >
< a href = "Phaser.Signal.html" > Signal< / a >
< / li >
2014-02-05 06:29:17 +00:00
< li >
< a href = "Phaser.SinglePad.html" > SinglePad< / a >
< / li >
2013-10-25 15:54:40 +00:00
< li >
< a href = "Phaser.Sound.html" > Sound< / a >
< / li >
< li >
< a href = "Phaser.SoundManager.html" > SoundManager< / a >
< / li >
< li >
< a href = "Phaser.Sprite.html" > Sprite< / a >
< / li >
2014-02-18 03:01:51 +00:00
< li >
< a href = "Phaser.SpriteBatch.html" > SpriteBatch< / a >
< / li >
2013-10-25 15:54:40 +00:00
< li >
< a href = "Phaser.Stage.html" > Stage< / a >
< / li >
< li >
< a href = "Phaser.State.html" > State< / a >
< / li >
< li >
< a href = "Phaser.StateManager.html" > StateManager< / a >
< / li >
< li >
< a href = "Phaser.Text.html" > Text< / a >
< / li >
2013-11-28 15:57:09 +00:00
< li >
< a href = "Phaser.Tile.html" > Tile< / a >
< / li >
< li >
< a href = "Phaser.Tilemap.html" > Tilemap< / a >
< / li >
< li >
< a href = "Phaser.TilemapLayer.html" > TilemapLayer< / a >
< / li >
< li >
< a href = "Phaser.TilemapParser.html" > TilemapParser< / a >
< / li >
< li >
< a href = "Phaser.Tileset.html" > Tileset< / a >
< / li >
2013-10-25 15:54:40 +00:00
< li >
< a href = "Phaser.TileSprite.html" > TileSprite< / a >
< / li >
< li >
< a href = "Phaser.Time.html" > Time< / a >
< / li >
2013-11-28 15:57:09 +00:00
< li >
< a href = "Phaser.Timer.html" > Timer< / a >
< / li >
2014-02-05 06:29:17 +00:00
< li >
< a href = "Phaser.TimerEvent.html" > TimerEvent< / a >
< / li >
2013-10-25 15:54:40 +00:00
< li >
< a href = "Phaser.Touch.html" > Touch< / a >
< / li >
< li >
< a href = "Phaser.Tween.html" > Tween< / a >
< / li >
< li >
< a href = "Phaser.TweenManager.html" > TweenManager< / a >
< / li >
< li >
< a href = "Phaser.Utils.html" > Utils< / a >
< / li >
< li >
< a href = "Phaser.Utils.Debug.html" > Debug< / a >
< / li >
< li >
< a href = "Phaser.World.html" > World< / a >
< / li >
< li >
< a href = "SignalBinding.html" > SignalBinding< / a >
< / li >
< / ul >
< / li >
< / ul >
< / div >
< / div >
< div class = "row-fluid" >
< div class = "span8" >
< div id = "main" >
< h1 class = "page-title" > Class: Arcade< / h1 >
< section >
< header >
< h2 >
< span class = "ancestors" > < a href = "Phaser.html" > Phaser< / a > < a href = "Phaser.Physics.html" > .Physics< / a > .< / span >
Arcade
< / h2 >
< div class = "class-description" > < p > Arcade Physics Constructor< / p > < / div >
< / header >
< article >
< div class = "container-overview" >
< dt >
< h4 class = "name" id = "Arcade" > < span class = "type-signature" > < / span > new Arcade< span class = "signature" > (game)< / span > < span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Arcade Physics constructor.< / p >
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > game< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "Phaser.Game.html" > Phaser.Game< / a > < / span >
< / td >
< td class = "description last" > < p > reference to the current game instance.< / p > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-14 06:36:05 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-15" > line 15< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
< / dd >
< / div >
2014-03-14 06:36:05 +00:00
< h3 class = "subsection-title" > Classes< / h3 >
< dl >
< dt > < a href = "Phaser.Physics.Arcade.Body.html" > Body< / a > < / dt >
< dd > < / dd >
< / dl >
2013-10-25 15:54:40 +00:00
< h3 class = "subsection-title" > Members< / h3 >
< dl >
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "bounds" > < span class = "type-signature" > < / span > bounds< span class = "type-signature" > < / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
2013-10-25 16:30:37 +00:00
< dl class = "details" >
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2014-03-14 06:36:05 +00:00
< h5 class = "subsection-title" > Properties:< / h5 >
2013-10-25 16:30:37 +00:00
2014-03-14 06:36:05 +00:00
< dl >
2013-10-25 16:30:37 +00:00
2014-03-14 06:36:05 +00:00
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
2013-10-25 16:30:37 +00:00
2014-03-14 06:36:05 +00:00
< th > Type< / th >
2013-10-25 16:30:37 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 16:30:37 +00:00
2014-03-14 06:36:05 +00:00
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< th class = "last" > Description< / th >
< / tr >
< / thead >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< tbody >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< tr >
< td class = "name" > < code > bounds< / code > < / td >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< td class = "type" >
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< span class = "param-type" > < a href = "Phaser.Rectangle.html" > Phaser.Rectangle< / a > < / span >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The bounds inside of which the physics world exists. Defaults to match the world bounds.< / p > < / td >
< / tr >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< / tbody >
< / table >
< / dl >
2014-02-05 06:29:17 +00:00
2013-10-25 15:54:40 +00:00
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-14 06:36:05 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-30" > line 30< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
2014-03-24 12:41:45 +00:00
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "checkCollision" > < span class = "type-signature" > < / span > checkCollision< span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Set the checkCollision properties to control for which bounds collision is processed.
For example checkCollision.down = false means Bodies cannot collide with the World.bounds.bottom.< / p >
< / div >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > checkCollision< / code > < / td >
< td class = "type" >
< span class = "param-type" > object< / span >
< / td >
< td class = "description last" > < p > An object containing allowed collision flags.< / p > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-37" > line 37< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "forceX" > < span class = "type-signature" > < / span > forceX< span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > forceX< / code > < / td >
< td class = "type" >
< span class = "param-type" > boolean< / span >
< / td >
< td class = "description last" > < p > If true World.separate will always separate on the X axis before Y. Otherwise it will check gravity totals first.< / p > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-62" > line 62< / a >
< / li > < / ul > < / dd >
2013-10-25 15:54:40 +00:00
< / dl >
< / dd >
< dt >
2013-10-25 16:30:37 +00:00
< h4 class = "name" id = "game" > < span class = "type-signature" > < / span > game< span class = "type-signature" > < / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
2013-10-25 16:30:37 +00:00
< dl class = "details" >
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > game< / code > < / td >
< td class = "type" >
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
< span class = "param-type" > < a href = "Phaser.Game.html" > Phaser.Game< / a > < / span >
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
< / td >
< td class = "description last" > < p > Local reference to game.< / p > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
2013-10-25 15:54:40 +00:00
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-14 06:36:05 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-20" > line 20< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
< / dd >
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
< dt >
2013-10-25 16:30:37 +00:00
< h4 class = "name" id = "gravity" > < span class = "type-signature" > < / span > gravity< span class = "type-signature" > < / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
2013-10-25 16:30:37 +00:00
< dl class = "details" >
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
2013-10-25 15:54:40 +00:00
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2013-10-25 16:30:37 +00:00
< td class = "name" > < code > gravity< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2013-10-25 16:30:37 +00:00
< span class = "param-type" > < a href = "Phaser.Point.html" > Phaser.Point< / a > < / span >
2013-10-25 15:54:40 +00:00
< / td >
2013-10-25 16:30:37 +00:00
< td class = "description last" > < p > The World gravity setting. Defaults to x: 0, y: 0, or no gravity.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
2013-10-25 16:30:37 +00:00
< / tbody >
< / table >
< / dl >
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-14 06:36:05 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-25" > line 25< / a >
2013-10-25 16:30:37 +00:00
< / li > < / ul > < / dd >
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "maxLevels" > < span class = "type-signature" > < / span > maxLevels< span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > maxLevels< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > Used by the QuadTree to set the maximum number of iteration levels.< / p > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-24 12:41:45 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-47" > line 47< / a >
2013-10-25 16:30:37 +00:00
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "maxObjects" > < span class = "type-signature" > < / span > maxObjects< span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > maxObjects< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > Used by the QuadTree to set the maximum number of objects per quad.< / p > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-24 12:41:45 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-42" > line 42< / a >
2013-10-25 16:30:37 +00:00
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "OVERLAP_BIAS" > < span class = "type-signature" > < / span > OVERLAP_BIAS< span class = "type-signature" > < / span > < / h4 >
2013-10-25 16:30:37 +00:00
< / dt >
< dd >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > OVERLAP_BIAS< / code > < / td >
2013-10-25 16:30:37 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
2013-10-25 16:30:37 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > A value added to the delta values during collision checks.< / p > < / td >
2013-10-25 16:30:37 +00:00
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-24 12:41:45 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-52" > line 52< / a >
2013-10-25 16:30:37 +00:00
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "quadTree" > < span class = "type-signature" > < / span > quadTree< span class = "type-signature" > < / span > < / h4 >
2013-10-25 16:30:37 +00:00
< / dt >
< dd >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > quadTree< / code > < / td >
2013-10-25 16:30:37 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > < a href = "Phaser.QuadTree.html" > Phaser.QuadTree< / a > < / span >
2013-10-25 16:30:37 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The world QuadTree.< / p > < / td >
2013-10-25 16:30:37 +00:00
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-24 12:41:45 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-67" > line 67< / a >
2013-10-25 16:30:37 +00:00
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "TILE_BIAS" > < span class = "type-signature" > < / span > TILE_BIAS< span class = "type-signature" > < / span > < / h4 >
2013-10-25 16:30:37 +00:00
< / dt >
< dd >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > TILE_BIAS< / code > < / td >
2013-10-25 16:30:37 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
2013-10-25 16:30:37 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > A value added to the delta values during collision with tiles. Adjust this if you get tunnelling.< / p > < / td >
2013-10-25 16:30:37 +00:00
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-24 12:41:45 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-57" > line 57< / a >
2013-10-25 16:30:37 +00:00
< / li > < / ul > < / dd >
< / dl >
< / dd >
2014-03-14 06:36:05 +00:00
< / dl >
< h3 class = "subsection-title" > Methods< / h3 >
< dl >
2013-10-25 16:30:37 +00:00
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "accelerateToObject" > < span class = "type-signature" > < / span > accelerateToObject< span class = "signature" > (displayObject, destination, < span class = "optional" > speed< / span > , < span class = "optional" > xSpeedMax< / span > , < span class = "optional" > ySpeedMax< / span > )< / span > < span class = "type-signature" > → {number}< / span > < / h4 >
2013-10-25 16:30:37 +00:00
< / dt >
< dd >
2014-03-14 06:36:05 +00:00
< div class = "description" >
< p > Sets the acceleration.x/y property on the display object so it will move towards the target at the given speed (in pixels per second sq.)
You must give a maximum speed value, beyond which the display object won't go any faster.
Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.
Note: The display object doesn't stop moving once it reaches the destination coordinates.< / p >
< / div >
2013-10-25 16:30:37 +00:00
2014-03-14 06:36:05 +00:00
< h5 > Parameters:< / h5 >
2013-10-25 16:30:37 +00:00
2014-03-14 06:36:05 +00:00
< table class = "params table table-striped" >
2013-10-25 16:30:37 +00:00
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
2014-03-14 06:36:05 +00:00
< th > Argument< / th >
2013-10-25 16:30:37 +00:00
2014-03-14 06:36:05 +00:00
< th > Default< / th >
2013-10-25 16:30:37 +00:00
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > displayObject< / code > < / td >
2013-10-25 16:30:37 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > any< / span >
2013-10-25 16:30:37 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "attributes" >
< / td >
2013-10-25 16:30:37 +00:00
2014-03-14 06:36:05 +00:00
< td class = "default" >
< / td >
2013-10-25 16:30:37 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The display object to move.< / p > < / td >
2013-10-25 16:30:37 +00:00
< / tr >
2014-03-14 06:36:05 +00:00
< tr >
< td class = "name" > < code > destination< / code > < / td >
< td class = "type" >
< span class = "param-type" > any< / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "default" >
< / td >
< td class = "description last" > < p > The display object to move towards. Can be any object but must have visible x/y properties.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > speed< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
60
< / td >
< td class = "description last" > < p > The speed it will accelerate in pixels per second.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > xSpeedMax< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
500
< / td >
< td class = "description last" > < p > The maximum x velocity the display object can reach.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > ySpeedMax< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
500
< / td >
< td class = "description last" > < p > The maximum y velocity the display object can reach.< / p > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
2014-02-05 06:29:17 +00:00
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-1479" > line 1479< / a >
2014-02-05 06:29:17 +00:00
< / li > < / ul > < / dd >
< / dl >
2014-03-14 06:36:05 +00:00
< h5 > Returns:< / h5 >
< div class = "param-desc" >
< p > The angle (in radians) that the object should be visually set to in order to match its new trajectory.< / p >
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > number< / span >
< / dd >
< / dl >
2014-02-05 06:29:17 +00:00
< / dd >
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "accelerateToPointer" > < span class = "type-signature" > < / span > accelerateToPointer< span class = "signature" > (displayObject, < span class = "optional" > pointer< / span > , < span class = "optional" > speed< / span > , < span class = "optional" > xSpeedMax< / span > , < span class = "optional" > ySpeedMax< / span > )< / span > < span class = "type-signature" > → {number}< / span > < / h4 >
2014-02-05 06:29:17 +00:00
< / dt >
< dd >
2014-03-14 06:36:05 +00:00
< div class = "description" >
< p > Sets the acceleration.x/y property on the display object so it will move towards the target at the given speed (in pixels per second sq.)
You must give a maximum speed value, beyond which the display object won't go any faster.
Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.
Note: The display object doesn't stop moving once it reaches the destination coordinates.< / p >
< / div >
2014-02-05 06:29:17 +00:00
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< h5 > Parameters:< / h5 >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< table class = "params table table-striped" >
2014-02-05 06:29:17 +00:00
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
2014-03-14 06:36:05 +00:00
< th > Argument< / th >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< th > Default< / th >
2014-02-05 06:29:17 +00:00
< th class = "last" > Description< / th >
< / tr >
< / thead >
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
< tbody >
2013-10-25 16:30:37 +00:00
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > displayObject< / code > < / td >
2013-10-25 16:30:37 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > any< / span >
2013-10-25 15:54:40 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "attributes" >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / td >
< td class = "default" >
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The display object to move.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
2014-03-14 06:36:05 +00:00
< tr >
< td class = "name" > < code > pointer< / code > < / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "type" >
< span class = "param-type" > < a href = "Phaser.Pointer.html" > Phaser.Pointer< / a > < / span >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "attributes" >
< optional>< br >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "default" >
< / td >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The pointer to move towards. Defaults to Phaser.Input.activePointer.< / p > < / td >
< / tr >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< tr >
< td class = "name" > < code > speed< / code > < / td >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< td class = "type" >
< span class = "param-type" > number< / span >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2014-02-05 06:29:17 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "attributes" >
< optional>< br >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< td class = "default" >
60
< / td >
< td class = "description last" > < p > The speed it will accelerate in pixels per second.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > xSpeedMax< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< td class = "attributes" >
< optional>< br >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< td class = "default" >
500
< / td >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The maximum x velocity the display object can reach.< / p > < / td >
< / tr >
2013-10-25 15:54:40 +00:00
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > ySpeedMax< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "attributes" >
< optional>< br >
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "default" >
500
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The maximum y velocity the display object can reach.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< / tbody >
< / table >
2014-03-14 06:36:05 +00:00
< dl class = "details" >
2013-10-25 15:54:40 +00:00
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-1508" > line 1508< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
2014-03-14 06:36:05 +00:00
< h5 > Returns:< / h5 >
< div class = "param-desc" >
< p > The angle (in radians) that the object should be visually set to in order to match its new trajectory.< / p >
< / div >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > number< / span >
< / dd >
< / dl >
< / dd >
2013-10-25 15:54:40 +00:00
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "accelerateToXY" > < span class = "type-signature" > < / span > accelerateToXY< span class = "signature" > (displayObject, x, y, < span class = "optional" > speed< / span > , < span class = "optional" > xSpeedMax< / span > , < span class = "optional" > ySpeedMax< / span > )< / span > < span class = "type-signature" > → {number}< / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-14 06:36:05 +00:00
< p > Sets the acceleration.x/y property on the display object so it will move towards the x/y coordinates at the given speed (in pixels per second sq.)
2013-10-25 15:54:40 +00:00
You must give a maximum speed value, beyond which the display object won't go any faster.
Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.
Note: The display object doesn't stop moving once it reaches the destination coordinates.< / p >
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th > Argument< / th >
< th > Default< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > displayObject< / code > < / td >
< td class = "type" >
< span class = "param-type" > any< / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "default" >
< / td >
< td class = "description last" > < p > The display object to move.< / p > < / td >
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > x< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
< / td >
< td class = "attributes" >
< / td >
< td class = "default" >
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The x coordinate to accelerate towards.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > y< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "default" >
< / td >
< td class = "description last" > < p > The y coordinate to accelerate towards.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< tr >
< td class = "name" > < code > speed< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
60
< / td >
< td class = "description last" > < p > The speed it will accelerate in pixels per second.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > xSpeedMax< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
500
< / td >
< td class = "description last" > < p > The maximum x velocity the display object can reach.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > ySpeedMax< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
500
< / td >
< td class = "description last" > < p > The maximum y velocity the display object can reach.< / p > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-1538" > line 1538< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
< p > The angle (in radians) that the object should be visually set to in order to match its new trajectory.< / p >
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > number< / span >
< / dd >
< / dl >
< / dd >
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "accelerationFromRotation" > < span class = "type-signature" > < / span > accelerationFromRotation< span class = "signature" > (rotation, < span class = "optional" > speed< / span > , < span class = "optional" > point< / span > )< / span > < span class = "type-signature" > → {< a href = "Phaser.Point.html" > Phaser.Point< / a > }< / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-14 06:36:05 +00:00
< p > Given the rotation (in radians) and speed calculate the acceleration and return it as a Point object, or set it to the given point object.
One way to use this is: accelerationFromRotation(rotation, 200, sprite.acceleration) which will set the values directly to the sprites acceleration and not create a new Point object.< / p >
2013-10-25 15:54:40 +00:00
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th > Argument< / th >
< th > Default< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > rotation< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
< / td >
< td class = "attributes" >
< / td >
< td class = "default" >
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The angle in radians.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > speed< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
60
< / td >
< td class = "description last" > < p > The speed it will move, in pixels per second sq.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > point< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "Phaser.Point.html" > Phaser.Point< / a > < / span >
|
< span class = "param-type" > object< / span >
2013-10-25 15:54:40 +00:00
< / td >
< td class = "attributes" >
2014-02-05 06:29:17 +00:00
< optional>< br >
2013-10-25 15:54:40 +00:00
< / td >
< td class = "default" >
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The Point object in which the x and y properties will be set to the calculated acceleration.< / p > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-1460" > line 1460< / a >
2014-03-14 06:36:05 +00:00
< / li > < / ul > < / dd >
< / dl >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
< ul >
< li > A Point where point.x contains the acceleration x value and point.y contains the acceleration y value.< / li >
< / ul >
< / div >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > < a href = "Phaser.Point.html" > Phaser.Point< / a > < / span >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / dd >
< / dl >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / dd >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< dt >
< h4 class = "name" id = "angleBetween" > < span class = "type-signature" > < / span > angleBetween< span class = "signature" > (source, target)< / span > < span class = "type-signature" > → {number}< / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Find the angle in radians between two display objects (like Sprites).< / p >
< / div >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< h5 > Parameters:< / h5 >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< th > Type< / th >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< th class = "last" > Description< / th >
< / tr >
< / thead >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< tbody >
2013-10-25 15:54:40 +00:00
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > source< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > any< / span >
2013-10-25 15:54:40 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The Display Object to test from.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > target< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > any< / span >
2013-10-25 15:54:40 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The Display Object to test to.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-1626" > line 1626< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
2014-03-14 06:36:05 +00:00
< p > The angle in radians between the source and target display objects.< / p >
2013-10-25 15:54:40 +00:00
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > number< / span >
< / dd >
< / dl >
< / dd >
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "angleToPointer" > < span class = "type-signature" > < / span > angleToPointer< span class = "signature" > (displayObject, < span class = "optional" > pointer< / span > )< / span > < span class = "type-signature" > → {number}< / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-14 06:36:05 +00:00
< p > Find the angle in radians between a display object (like a Sprite) and a Pointer, taking their x/y and center into account.< / p >
2013-10-25 15:54:40 +00:00
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th > Argument< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2014-02-05 06:29:17 +00:00
< td class = "name" > < code > displayObject< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-02-05 06:29:17 +00:00
< span class = "param-type" > any< / span >
2013-10-25 15:54:40 +00:00
< / td >
< td class = "attributes" >
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The Display Object to test from.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > pointer< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > < a href = "Phaser.Pointer.html" > Phaser.Pointer< / a > < / span >
2013-10-25 15:54:40 +00:00
< / td >
< td class = "attributes" >
2014-03-14 06:36:05 +00:00
< optional>< br >
2013-10-25 15:54:40 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The Phaser.Pointer to test to. If none is given then Input.activePointer is used.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
2014-03-14 06:36:05 +00:00
< / tbody >
< / table >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< dl class = "details" >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-1661" > line 1661< / a >
2014-03-14 06:36:05 +00:00
< / li > < / ul > < / dd >
< / dl >
< h5 > Returns:< / h5 >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< div class = "param-desc" >
< p > The angle in radians between displayObject.x/y to Pointer.x/y< / p >
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
2014-02-05 06:29:17 +00:00
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / dd >
< / dl >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / dd >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< dt >
< h4 class = "name" id = "angleToXY" > < span class = "type-signature" > < / span > angleToXY< span class = "signature" > (displayObject, x, y)< / span > < span class = "type-signature" > → {number}< / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Find the angle in radians between a display object (like a Sprite) and the given x/y coordinate.< / p >
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< th > Type< / th >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< th class = "last" > Description< / th >
< / tr >
< / thead >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< tbody >
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > displayObject< / code > < / td >
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > any< / span >
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
< / td >
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The Display Object to test from.< / p > < / td >
2014-02-05 06:29:17 +00:00
< / tr >
2013-10-25 15:54:40 +00:00
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > x< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-02-05 06:29:17 +00:00
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The x coordinate to get the angle to.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > y< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-02-05 06:29:17 +00:00
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
< / td >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The y coordinate to get the angle to.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-1643" > line 1643< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
2014-03-14 06:36:05 +00:00
< p > The angle in radians between displayObject.x/y to Pointer.x/y< / p >
2013-10-25 15:54:40 +00:00
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > number< / span >
< / dd >
< / dl >
< / dd >
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "checkWorldBounds" > < span class = "type-signature" > < protected> < / span > checkWorldBounds< span class = "signature" > ()< / span > < span class = "type-signature" > < / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-14 06:36:05 +00:00
< p > Internal method.< / p >
< / div >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "Body.js.html" > physics/arcade/Body.js< / a > , < a href = "Body.js.html#sunlight-1-line-513" > line 513< / a >
2014-03-14 06:36:05 +00:00
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "collide" > < span class = "type-signature" > < / span > collide< span class = "signature" > (object1, object2, < span class = "optional" > collideCallback< / span > , < span class = "optional" > processCallback< / span > , < span class = "optional" > callbackContext< / span > )< / span > < span class = "type-signature" > → {boolean}< / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Checks for collision between two game objects. You can perform Sprite vs. Sprite, Sprite vs. Group, Group vs. Group, Sprite vs. Tilemap Layer or Group vs. Tilemap Layer collisions.
The second parameter can be an array of objects, of differing types.
The objects are also automatically separated. If you don't require separation then use ArcadePhysics.overlap instead.
An optional processCallback can be provided. If given this function will be called when two sprites are found to be colliding. It is called before any separation takes place,
giving you the chance to perform additional checks. If the function returns true then the collision and separation is carried out. If it returns false it is skipped.
The collideCallback is an optional function that is only called if two sprites collide. If a processCallback has been set then it needs to return true for collideCallback to be called.< / p >
2013-10-25 15:54:40 +00:00
< / div >
< h5 > Parameters:< / h5 >
2014-03-14 06:36:05 +00:00
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th > Argument< / th >
< th > Default< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > object1< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "Phaser.Sprite.html" > Phaser.Sprite< / a > < / span >
|
< span class = "param-type" > < a href = "Phaser.Group.html" > Phaser.Group< / a > < / span >
|
< span class = "param-type" > Phaser.Particles.Emitter< / span >
|
< span class = "param-type" > < a href = "Phaser.Tilemap.html" > Phaser.Tilemap< / a > < / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "default" >
< / td >
< td class = "description last" > < p > The first object to check. Can be an instance of Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter, or Phaser.Tilemap.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > object2< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "Phaser.Sprite.html" > Phaser.Sprite< / a > < / span >
|
< span class = "param-type" > < a href = "Phaser.Group.html" > Phaser.Group< / a > < / span >
|
< span class = "param-type" > Phaser.Particles.Emitter< / span >
|
< span class = "param-type" > < a href = "Phaser.Tilemap.html" > Phaser.Tilemap< / a > < / span >
|
< span class = "param-type" > array< / span >
< / td >
< td class = "attributes" >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "default" >
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The second object or array of objects to check. Can be Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter or Phaser.Tilemap.< / p > < / td >
< / tr >
2013-10-25 15:54:40 +00:00
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > collideCallback< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > function< / span >
2013-10-25 15:54:40 +00:00
< / td >
< td class = "attributes" >
2014-03-14 06:36:05 +00:00
< optional>< br >
2013-10-25 15:54:40 +00:00
< / td >
2014-02-05 06:29:17 +00:00
< td class = "default" >
2014-03-14 06:36:05 +00:00
null
2014-02-05 06:29:17 +00:00
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > processCallback< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > function< / span >
2013-10-25 15:54:40 +00:00
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
2014-02-05 06:29:17 +00:00
< td class = "default" >
2014-03-14 06:36:05 +00:00
null
2014-02-05 06:29:17 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collision will only happen if processCallback returns true. The two objects will be passed to this function in the same order in which you specified them.< / p > < / td >
2014-02-05 06:29:17 +00:00
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > callbackContext< / code > < / td >
2014-02-05 06:29:17 +00:00
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
< td class = "type" >
< span class = "param-type" > object< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The context in which to run the callbacks.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-24 12:41:45 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-370" > line 370< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
2014-03-14 06:36:05 +00:00
< p > True if a collision occured otherwise false.< / p >
2013-10-25 15:54:40 +00:00
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > boolean< / span >
2013-10-25 15:54:40 +00:00
< / dd >
< / dl >
< / dd >
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "computeVelocity" > < span class = "type-signature" > < / span > computeVelocity< span class = "signature" > (axis, body, velocity, acceleration, drag, < span class = "optional" > max< / span > )< / span > < span class = "type-signature" > → {number}< / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-14 06:36:05 +00:00
< p > A tween-like function that takes a starting velocity and some other factors and returns an altered velocity.
Based on a function in Flixel by @ADAMATOMIC< / p >
2013-10-25 15:54:40 +00:00
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
2014-03-14 06:36:05 +00:00
< th > Argument< / th >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< th > Default< / th >
2013-10-25 15:54:40 +00:00
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > axis< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "attributes" >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "default" >
< / td >
< td class = "description last" > < p > 0 for nothing, 1 for horizontal, 2 for vertical.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > body< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > < a href = "Phaser.Physics.Arcade.Body.html" > Phaser.Physics.Arcade.Body< / a > < / span >
2013-10-25 15:54:40 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "attributes" >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "default" >
< / td >
< td class = "description last" > < p > The Body object to be updated.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
2014-03-14 06:36:05 +00:00
< tr >
< td class = "name" > < code > velocity< / code > < / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "type" >
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "attributes" >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "default" >
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > Any component of velocity (e.g. 20).< / p > < / td >
< / tr >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< tr >
< td class = "name" > < code > acceleration< / code > < / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "type" >
2013-10-25 15:54:40 +00:00
< span class = "param-type" > number< / span >
2013-10-25 16:30:37 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< td class = "attributes" >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< td class = "default" >
< / td >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > Rate at which the velocity is changing.< / p > < / td >
< / tr >
2014-02-05 06:29:17 +00:00
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > drag< / code > < / td >
2014-02-05 06:29:17 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
2014-02-05 06:29:17 +00:00
< / td >
< td class = "attributes" >
< / td >
2014-03-14 06:36:05 +00:00
< td class = "default" >
< / td >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > Really kind of a deceleration, this is how much the velocity changes if Acceleration is not set.< / p > < / td >
2014-02-05 06:29:17 +00:00
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > max< / code > < / td >
2014-02-05 06:29:17 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
2014-02-05 06:29:17 +00:00
< / td >
< td class = "attributes" >
< optional>< br >
2014-03-14 06:36:05 +00:00
< / td >
< td class = "default" >
10000
2014-02-05 06:29:17 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > An absolute value cap for the velocity.< / p > < / td >
2014-02-05 06:29:17 +00:00
< / tr >
< / tbody >
< / table >
2013-10-25 16:30:37 +00:00
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-24 12:41:45 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-270" > line 270< / a >
2013-10-25 16:30:37 +00:00
< / li > < / ul > < / dd >
< / dl >
2014-02-05 06:29:17 +00:00
< h5 > Returns:< / h5 >
< div class = "param-desc" >
2014-03-14 06:36:05 +00:00
< p > The altered Velocity value.< / p >
2014-02-05 06:29:17 +00:00
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > number< / span >
< / dd >
< / dl >
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
< / dd >
< dt >
2014-03-24 12:41:45 +00:00
< h4 class = "name" id = "destroy" > < span class = "type-signature" > < / span > destroy< span class = "signature" > ()< / span > < span class = "type-signature" > < / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-24 12:41:45 +00:00
< p > Removes this bodies reference to its parent sprite, freeing it up for gc.< / p >
2013-10-25 15:54:40 +00:00
< / div >
2014-03-24 12:41:45 +00:00
< dl class = "details" >
2013-10-25 15:54:40 +00:00
2014-03-24 12:41:45 +00:00
2013-10-25 15:54:40 +00:00
2014-03-24 12:41:45 +00:00
2013-10-25 15:54:40 +00:00
2014-03-24 12:41:45 +00:00
2013-10-25 15:54:40 +00:00
2014-03-24 12:41:45 +00:00
2013-10-25 15:54:40 +00:00
2014-03-24 12:41:45 +00:00
2013-10-25 15:54:40 +00:00
2014-03-24 12:41:45 +00:00
2013-10-25 15:54:40 +00:00
2014-03-24 12:41:45 +00:00
2013-10-25 15:54:40 +00:00
2014-03-24 12:41:45 +00:00
2013-10-25 15:54:40 +00:00
2014-03-24 12:41:45 +00:00
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "Body.js.html" > physics/arcade/Body.js< / a > , < a href = "Body.js.html#sunlight-1-line-502" > line 502< / a >
2014-03-24 12:41:45 +00:00
< / li > < / ul > < / dd >
2013-10-25 15:54:40 +00:00
2014-03-24 12:41:45 +00:00
2013-10-25 15:54:40 +00:00
2014-03-24 12:41:45 +00:00
2013-10-25 15:54:40 +00:00
2014-03-24 12:41:45 +00:00
< / dl >
2013-10-25 15:54:40 +00:00
2014-03-24 12:41:45 +00:00
2013-10-25 15:54:40 +00:00
2014-03-24 12:41:45 +00:00
< / dd >
< dt >
< h4 class = "name" id = "distanceBetween" > < span class = "type-signature" > < / span > distanceBetween< span class = "signature" > (source, target)< / span > < span class = "type-signature" > → {number}< / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Find the distance between two display objects (like Sprites).< / p >
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > source< / code > < / td >
< td class = "type" >
< span class = "param-type" > any< / span >
< / td >
< td class = "description last" > < p > The Display Object to test from.< / p > < / td >
< / tr >
2013-10-25 15:54:40 +00:00
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > target< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > any< / span >
2013-10-25 15:54:40 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The Display Object to test to.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-1568" > line 1568< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
2014-03-14 06:36:05 +00:00
< p > The distance between the source and target objects.< / p >
2013-10-25 15:54:40 +00:00
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
2014-02-05 06:29:17 +00:00
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
< / dd >
< / dl >
< / dd >
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "distanceToPointer" > < span class = "type-signature" > < / span > distanceToPointer< span class = "signature" > (displayObject, < span class = "optional" > pointer< / span > )< / span > < span class = "type-signature" > → {number}< / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-14 06:36:05 +00:00
< p > Find the distance between a display object (like a Sprite) and a Pointer. If no Pointer is given the Input.activePointer is used.
The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed.
If you need to calculate from the center of a display object instead use the method distanceBetweenCenters()< / p >
2013-10-25 15:54:40 +00:00
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
2014-03-14 06:36:05 +00:00
< th > Argument< / th >
2013-10-25 15:54:40 +00:00
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > displayObject< / code > < / td >
< td class = "type" >
< span class = "param-type" > any< / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "description last" > < p > The Display Object to test from.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > pointer< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > < a href = "Phaser.Pointer.html" > Phaser.Pointer< / a > < / span >
2013-10-25 15:54:40 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "attributes" >
< optional>< br >
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The Phaser.Pointer to test to. If none is given then Input.activePointer is used.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-1605" > line 1605< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
2014-03-14 06:36:05 +00:00
< p > The distance between the object and the Pointer.< / p >
2013-10-25 15:54:40 +00:00
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
< / dd >
< / dl >
< / dd >
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "distanceToXY" > < span class = "type-signature" > < / span > distanceToXY< span class = "signature" > (displayObject, x, y)< / span > < span class = "type-signature" > → {number}< / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-14 06:36:05 +00:00
< p > Find the distance between a display object (like a Sprite) and the given x/y coordinates.
The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed.
If you need to calculate from the center of a display object instead use the method distanceBetweenCenters()< / p >
2013-10-25 16:30:37 +00:00
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > displayObject< / code > < / td >
2014-02-05 06:29:17 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > any< / span >
2014-02-05 06:29:17 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The Display Object to test from.< / p > < / td >
2014-02-05 06:29:17 +00:00
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > x< / code > < / td >
2014-02-05 06:29:17 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
2014-02-05 06:29:17 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The x coordinate to move towards.< / p > < / td >
2014-02-05 06:29:17 +00:00
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > y< / code > < / td >
2014-02-05 06:29:17 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The y coordinate to move towards.< / p > < / td >
2013-10-25 16:30:37 +00:00
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-1585" > line 1585< / a >
2013-10-25 16:30:37 +00:00
< / li > < / ul > < / dd >
< / dl >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
2014-03-14 06:36:05 +00:00
< p > The distance between the object and the x/y coordinates.< / p >
2013-10-25 16:30:37 +00:00
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
2013-10-25 16:30:37 +00:00
< / dd >
< / dl >
< / dd >
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "enable" > < span class = "type-signature" > < / span > enable< span class = "signature" > (object, < span class = "optional" > children< / span > )< / span > < span class = "type-signature" > < / span > < / h4 >
2013-10-25 16:30:37 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-14 06:36:05 +00:00
< p > This will create an Arcade Physics body on the given game object or array of game objects.
A game object can only have 1 physics body active at any one time, and it can't be changed until the object is destroyed.< / p >
2013-10-25 15:54:40 +00:00
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
2014-03-14 06:36:05 +00:00
< th > Argument< / th >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< th > Default< / th >
2013-10-25 15:54:40 +00:00
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > object< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > object< / span >
|
< span class = "param-type" > array< / span >
|
< span class = "param-type" > < a href = "Phaser.Group.html" > Phaser.Group< / a > < / span >
2013-10-25 15:54:40 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "attributes" >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "default" >
< / td >
< td class = "description last" > < p > The game object to create the physics body on. Can also be an array or Group of objects, a body will be created on every child that has a < code > body< / code > property.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > children< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > boolean< / span >
2013-10-25 15:54:40 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "attributes" >
< optional>< br >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "default" >
true
< / td >
< td class = "description last" > < p > Should a body be created on all children of this object? If true it will recurse down the display list as far as it can go.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-24 12:41:45 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-181" > line 181< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "enableBody" > < span class = "type-signature" > < / span > enableBody< span class = "signature" > (object)< / span > < span class = "type-signature" > < / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-14 06:36:05 +00:00
< p > Creates an Arcade Physics body on the given game object.
A game object can only have 1 physics body active at any one time, and it can't be changed until the body is nulled.< / p >
2013-10-25 15:54:40 +00:00
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > object< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > object< / span >
2013-10-25 15:54:40 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The game object to create the physics body on. A body will only be created if this object has a null < code > body< / code > property.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-24 12:41:45 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-237" > line 237< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "intersects" > < span class = "type-signature" > < / span > intersects< span class = "signature" > (body1, body2)< / span > < span class = "type-signature" > → {boolean}< / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Check for intersection against two bodies.< / p >
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > body1< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "Phaser.Physics.Arcade.Body.html" > Phaser.Physics.Arcade.Body< / a > < / span >
< / td >
< td class = "description last" > < p > The Body object to check.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > body2< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "Phaser.Physics.Arcade.Body.html" > Phaser.Physics.Arcade.Body< / a > < / span >
< / td >
< td class = "description last" > < p > The Body object to check.< / p > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-771" > line 771< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
2014-03-24 12:41:45 +00:00
< h5 > Returns:< / h5 >
< div class = "param-desc" >
< p > True if they intersect, otherwise false.< / p >
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > boolean< / span >
< / dd >
< / dl >
2013-10-25 15:54:40 +00:00
< / dd >
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "moveToObject" > < span class = "type-signature" > < / span > moveToObject< span class = "signature" > (displayObject, destination, < span class = "optional" > speed< / span > , < span class = "optional" > maxTime< / span > )< / span > < span class = "type-signature" > → {number}< / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-14 06:36:05 +00:00
< p > Move the given display object towards the destination object at a steady velocity.
If you specify a maxTime then it will adjust the speed (overwriting what you set) so it arrives at the destination in that number of seconds.
Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms.
Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.
Note: The display object doesn't stop moving once it reaches the destination coordinates.
Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all)< / p >
2013-10-25 15:54:40 +00:00
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
2014-03-14 06:36:05 +00:00
< th > Argument< / th >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< th > Default< / th >
2013-10-25 15:54:40 +00:00
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > displayObject< / code > < / td >
< td class = "type" >
< span class = "param-type" > any< / span >
< / td >
2014-03-14 06:36:05 +00:00
< td class = "attributes" >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "default" >
< / td >
< td class = "description last" > < p > The display object to move.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > destination< / code > < / td >
< td class = "type" >
< span class = "param-type" > any< / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "default" >
< / td >
< td class = "description last" > < p > The display object to move towards. Can be any object but must have visible x/y properties.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > speed< / code > < / td >
2013-10-25 16:30:37 +00:00
< td class = "type" >
2014-02-05 06:29:17 +00:00
< span class = "param-type" > number< / span >
2013-10-25 16:30:37 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "attributes" >
< optional>< br >
2013-10-25 16:30:37 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2013-10-25 16:30:37 +00:00
2014-03-14 06:36:05 +00:00
< td class = "default" >
60
< / td >
< td class = "description last" > < p > The speed it will move, in pixels per second (default is 60 pixels/sec)< / p > < / td >
2013-10-25 16:30:37 +00:00
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > maxTime< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< optional>< br >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "default" >
0
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms.< / p > < / td >
2014-02-05 06:29:17 +00:00
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-1316" > line 1316< / a >
2014-02-05 06:29:17 +00:00
< / li > < / ul > < / dd >
< / dl >
< h5 > Returns:< / h5 >
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
< div class = "param-desc" >
2014-03-14 06:36:05 +00:00
< p > The angle (in radians) that the object should be visually set to in order to match its new velocity.< / p >
2014-02-05 06:29:17 +00:00
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > number< / span >
< / dd >
< / dl >
< / dd >
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "moveToPointer" > < span class = "type-signature" > < / span > moveToPointer< span class = "signature" > (displayObject, < span class = "optional" > speed< / span > , < span class = "optional" > pointer< / span > , < span class = "optional" > maxTime< / span > )< / span > < span class = "type-signature" > → {number}< / span > < / h4 >
2014-02-05 06:29:17 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-14 06:36:05 +00:00
< p > Move the given display object towards the pointer at a steady velocity. If no pointer is given it will use Phaser.Input.activePointer.
If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds.
Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms.
Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.
Note: The display object doesn't stop moving once it reaches the destination coordinates.< / p >
2014-02-05 06:29:17 +00:00
< / div >
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
2014-03-14 06:36:05 +00:00
< th > Argument< / th >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< th > Default< / th >
2014-02-05 06:29:17 +00:00
< th class = "last" > Description< / th >
< / tr >
< / thead >
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
< tbody >
2013-10-25 15:54:40 +00:00
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > displayObject< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > any< / span >
2013-10-25 15:54:40 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "attributes" >
< / td >
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< td class = "default" >
< / td >
2013-10-25 16:30:37 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The display object to move.< / p > < / td >
2014-02-05 06:29:17 +00:00
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > speed< / code > < / td >
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
< td class = "type" >
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
60
< / td >
< td class = "description last" > < p > The speed it will move, in pixels per second (default is 60 pixels/sec)< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > pointer< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "Phaser.Pointer.html" > Phaser.Pointer< / a > < / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
< / td >
< td class = "description last" > < p > The pointer to move towards. Defaults to Phaser.Input.activePointer.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > maxTime< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
2014-02-05 06:29:17 +00:00
< / td >
2013-10-25 16:30:37 +00:00
2014-03-14 06:36:05 +00:00
< td class = "attributes" >
< optional>< br >
< / td >
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< td class = "default" >
0
< / td >
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-1351" > line 1351< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
2014-03-14 06:36:05 +00:00
< p > The angle (in radians) that the object should be visually set to in order to match its new velocity.< / p >
2013-10-25 15:54:40 +00:00
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
< / dd >
< / dl >
< / dd >
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "moveToXY" > < span class = "type-signature" > < / span > moveToXY< span class = "signature" > (displayObject, x, y, < span class = "optional" > speed< / span > , < span class = "optional" > maxTime< / span > )< / span > < span class = "type-signature" > → {number}< / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-14 06:36:05 +00:00
< p > Move the given display object towards the x/y coordinates at a steady velocity.
2013-10-25 15:54:40 +00:00
If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds.
Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms.
Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.
2014-02-05 06:29:17 +00:00
Note: The display object doesn't stop moving once it reaches the destination coordinates.
Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all)< / p >
2013-10-25 15:54:40 +00:00
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th > Argument< / th >
< th > Default< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > displayObject< / code > < / td >
< td class = "type" >
< span class = "param-type" > any< / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "default" >
< / td >
< td class = "description last" > < p > The display object to move.< / p > < / td >
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > x< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
< / td >
< td class = "attributes" >
< / td >
< td class = "default" >
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The x coordinate to move towards.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > y< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "default" >
< / td >
< td class = "description last" > < p > The y coordinate to move towards.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< tr >
2014-02-05 06:29:17 +00:00
< td class = "name" > < code > speed< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-02-05 06:29:17 +00:00
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
2014-02-05 06:29:17 +00:00
60
2013-10-25 15:54:40 +00:00
< / td >
2014-02-05 06:29:17 +00:00
< td class = "description last" > < p > The speed it will move, in pixels per second (default is 60 pixels/sec)< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< tr >
< td class = "name" > < code > maxTime< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
0
< / td >
< td class = "description last" > < p > Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms.< / p > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-1386" > line 1386< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
< p > The angle (in radians) that the object should be visually set to in order to match its new velocity.< / p >
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > number< / span >
< / dd >
< / dl >
< / dd >
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "overlap" > < span class = "type-signature" > < / span > overlap< span class = "signature" > (object1, object2, < span class = "optional" > overlapCallback< / span > , < span class = "optional" > processCallback< / span > , < span class = "optional" > callbackContext< / span > )< / span > < span class = "type-signature" > → {boolean}< / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-14 06:36:05 +00:00
< p > Checks for overlaps between two game objects. The objects can be Sprites, Groups or Emitters.
You can perform Sprite vs. Sprite, Sprite vs. Group and Group vs. Group overlap checks.
Unlike collide the objects are NOT automatically separated or have any physics applied, they merely test for overlap results.
The second parameter can be an array of objects, of differing types.< / p >
2013-10-25 15:54:40 +00:00
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th > Argument< / th >
2013-10-25 16:30:37 +00:00
< th > Default< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > object1< / code > < / td >
2013-10-25 16:30:37 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > < a href = "Phaser.Sprite.html" > Phaser.Sprite< / a > < / span >
|
< span class = "param-type" > < a href = "Phaser.Group.html" > Phaser.Group< / a > < / span >
|
< span class = "param-type" > Phaser.Particles.Emitter< / span >
2013-10-25 16:30:37 +00:00
< / td >
< td class = "attributes" >
< / td >
< td class = "default" >
< / td >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The first object to check. Can be an instance of Phaser.Sprite, Phaser.Group or Phaser.Particles.Emitter.< / p > < / td >
2013-10-25 16:30:37 +00:00
< / tr >
2013-10-25 15:54:40 +00:00
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > object2< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "Phaser.Sprite.html" > Phaser.Sprite< / a > < / span >
|
< span class = "param-type" > < a href = "Phaser.Group.html" > Phaser.Group< / a > < / span >
|
< span class = "param-type" > Phaser.Particles.Emitter< / span >
|
< span class = "param-type" > array< / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "default" >
< / td >
< td class = "description last" > < p > The second object or array of objects to check. Can be Phaser.Sprite, Phaser.Group or Phaser.Particles.Emitter.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > overlapCallback< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > function< / span >
2013-10-25 15:54:40 +00:00
< / td >
< td class = "attributes" >
2014-02-05 06:29:17 +00:00
< optional>< br >
2013-10-25 15:54:40 +00:00
< / td >
< td class = "default" >
2014-03-14 06:36:05 +00:00
null
2014-02-05 06:29:17 +00:00
2013-10-25 15:54:40 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you specified them.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > processCallback< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > function< / span >
2013-10-25 15:54:40 +00:00
< / td >
< td class = "attributes" >
2014-02-05 06:29:17 +00:00
< optional>< br >
2013-10-25 15:54:40 +00:00
< / td >
< td class = "default" >
2014-03-14 06:36:05 +00:00
null
2013-10-25 15:54:40 +00:00
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then overlapCallback will only be called if processCallback returns true.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > callbackContext< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > object< / span >
2013-10-25 15:54:40 +00:00
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
< / td >
2014-03-14 06:36:05 +00:00
< td class = "description last" > < p > The context in which to run the callbacks.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
2014-02-05 06:29:17 +00:00
< / tbody >
< / table >
2013-10-25 15:54:40 +00:00
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-24 12:41:45 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-331" > line 331< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
2014-03-14 06:36:05 +00:00
< p > True if an overlap occured otherwise false.< / p >
2013-10-25 15:54:40 +00:00
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > boolean< / span >
2013-10-25 15:54:40 +00:00
< / dd >
< / dl >
< / dd >
< dt >
2014-03-14 06:36:05 +00:00
< h4 class = "name" id = "postUpdate" > < span class = "type-signature" > < protected> < / span > postUpdate< span class = "signature" > ()< / span > < span class = "type-signature" > < / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-14 06:36:05 +00:00
< p > Internal method.< / p >
2013-10-25 15:54:40 +00:00
< / div >
2014-03-14 06:36:05 +00:00
< dl class = "details" >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "Body.js.html" > physics/arcade/Body.js< / a > , < a href = "Body.js.html#sunlight-1-line-429" > line 429< / a >
2014-03-14 06:36:05 +00:00
< / li > < / ul > < / dd >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
< / dl >
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / dd >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< dt >
< h4 class = "name" id = "preUpdate" > < span class = "type-signature" > < protected> < / span > preUpdate< span class = "signature" > ()< / span > < span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Internal method.< / p >
< / div >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< dl class = "details" >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "Body.js.html" > physics/arcade/Body.js< / a > , < a href = "Body.js.html#sunlight-1-line-354" > line 354< / a >
2014-03-14 06:36:05 +00:00
< / li > < / ul > < / dd >
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
< / dl >
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
< / dd >
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
< dt >
2014-03-28 01:42:49 +00:00
< h4 class = "name" id = "reset" > < span class = "type-signature" > < / span > reset< span class = "signature" > (x, y)< / span > < span class = "type-signature" > < / span > < / h4 >
2014-03-14 06:36:05 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-28 01:42:49 +00:00
< p > Resets all Body values (velocity, acceleration, rotation, etc)< / p >
2014-03-14 06:36:05 +00:00
< / div >
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
< h5 > Parameters:< / h5 >
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
< th > Type< / th >
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
< th class = "last" > Description< / th >
< / tr >
< / thead >
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
< tbody >
2013-11-28 15:57:09 +00:00
< tr >
2014-03-28 01:42:49 +00:00
< td class = "name" > < code > x< / code > < / td >
2013-11-28 15:57:09 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
2013-11-28 15:57:09 +00:00
2014-03-28 01:42:49 +00:00
< span class = "param-type" > number< / span >
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
< / td >
2013-11-28 15:57:09 +00:00
2014-03-14 06:36:05 +00:00
2013-11-28 15:57:09 +00:00
2014-03-28 01:42:49 +00:00
< td class = "description last" > < p > The new x position of the Body.< / p > < / td >
2013-11-28 15:57:09 +00:00
< / tr >
< tr >
2014-03-28 01:42:49 +00:00
< td class = "name" > < code > y< / code > < / td >
2013-11-28 15:57:09 +00:00
< td class = "type" >
2014-02-05 06:29:17 +00:00
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
< / td >
2013-11-28 15:57:09 +00:00
2014-03-28 01:42:49 +00:00
< td class = "description last" > < p > The new x position of the Body.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
2013-10-25 16:30:37 +00:00
< / tbody >
< / table >
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
< dl class = "details" >
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "Body.js.html" > physics/arcade/Body.js< / a > , < a href = "Body.js.html#sunlight-1-line-577" > line 577< / a >
2013-10-25 16:30:37 +00:00
< / li > < / ul > < / dd >
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
< / dl >
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
< / dd >
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
< dt >
2014-03-28 01:42:49 +00:00
< h4 class = "name" id = "setBounds" > < span class = "type-signature" > < / span > setBounds< span class = "signature" > (x, y, width, height)< / span > < span class = "type-signature" > < / span > < / h4 >
2013-10-25 16:30:37 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-28 01:42:49 +00:00
< p > Updates the size of this physics world.< / p >
2013-10-25 16:30:37 +00:00
< / div >
2013-10-25 15:54:40 +00:00
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
< h5 > Parameters:< / h5 >
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
< th > Type< / th >
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
< th class = "last" > Description< / th >
< / tr >
< / thead >
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
< tbody >
2013-10-25 16:30:37 +00:00
2014-02-05 06:29:17 +00:00
< tr >
2014-03-28 01:42:49 +00:00
< td class = "name" > < code > x< / code > < / td >
2014-02-05 06:29:17 +00:00
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
< td class = "type" >
2014-03-28 01:42:49 +00:00
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
< / td >
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
2013-10-25 15:54:40 +00:00
2014-03-28 01:42:49 +00:00
< td class = "description last" > < p > Top left most corner of the world.< / p > < / td >
2014-02-05 06:29:17 +00:00
< / tr >
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
< tr >
2014-03-14 06:36:05 +00:00
< td class = "name" > < code > y< / code > < / td >
2014-02-05 06:29:17 +00:00
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
< / td >
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
2013-10-25 15:54:40 +00:00
2014-03-28 01:42:49 +00:00
< td class = "description last" > < p > Top left most corner of the world.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > width< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > New width of the world. Can never be smaller than the Game.width.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > height< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > New height of the world. Can never be smaller than the Game.height.< / p > < / td >
2014-02-05 06:29:17 +00:00
< / tr >
2013-10-25 15:54:40 +00:00
2014-02-05 06:29:17 +00:00
< / tbody >
< / table >
2013-10-25 15:54:40 +00:00
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-155" > line 155< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
2014-03-28 01:42:49 +00:00
< h4 class = "name" id = "setBoundsToWorld" > < span class = "type-signature" > < / span > setBoundsToWorld< span class = "signature" > ()< / span > < span class = "type-signature" > < / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-28 01:42:49 +00:00
< p > Updates the size of this physics world to match the size of the game world.< / p >
2013-10-25 15:54:40 +00:00
< / div >
2013-10-25 16:30:37 +00:00
2013-10-25 15:54:40 +00:00
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-170" > line 170< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
2014-03-28 01:42:49 +00:00
< h4 class = "name" id = "setSize" > < span class = "type-signature" > < / span > setSize< span class = "signature" > (width, height, offsetX, offsetY)< / span > < span class = "type-signature" > < / span > < / h4 >
2013-10-25 15:54:40 +00:00
< / dt >
< dd >
< div class = "description" >
2014-03-28 01:42:49 +00:00
< p > You can modify the size of the physics Body to be any dimension you need.
So it could be smaller or larger than the parent Sprite. You can also control the x and y offset, which
is the position of the Body relative to the top-left of the Sprite.< / p >
2013-10-25 15:54:40 +00:00
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2014-03-28 01:42:49 +00:00
< td class = "name" > < code > width< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-28 01:42:49 +00:00
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
< / td >
2014-02-05 06:29:17 +00:00
2014-03-28 01:42:49 +00:00
< td class = "description last" > < p > The width of the Body.< / p > < / td >
2014-02-05 06:29:17 +00:00
< / tr >
< tr >
2014-03-28 01:42:49 +00:00
< td class = "name" > < code > height< / code > < / td >
2014-02-05 06:29:17 +00:00
< td class = "type" >
2014-03-28 01:42:49 +00:00
< span class = "param-type" > number< / span >
2014-02-05 06:29:17 +00:00
< / td >
2014-03-28 01:42:49 +00:00
< td class = "description last" > < p > The height of the Body.< / p > < / td >
2014-02-05 06:29:17 +00:00
< / tr >
< tr >
2014-03-28 01:42:49 +00:00
< td class = "name" > < code > offsetX< / code > < / td >
2014-02-05 06:29:17 +00:00
< td class = "type" >
2014-03-28 01:42:49 +00:00
< span class = "param-type" > number< / span >
2014-02-05 06:29:17 +00:00
< / td >
2013-10-25 15:54:40 +00:00
2014-03-28 01:42:49 +00:00
< td class = "description last" > < p > The X offset of the Body from the Sprite position.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
< tr >
2014-03-28 01:42:49 +00:00
< td class = "name" > < code > offsetY< / code > < / td >
2013-10-25 15:54:40 +00:00
< td class = "type" >
2014-03-28 01:42:49 +00:00
< span class = "param-type" > number< / span >
2013-10-25 15:54:40 +00:00
< / td >
2014-03-28 01:42:49 +00:00
< td class = "description last" > < p > The Y offset of the Body from the Sprite position.< / p > < / td >
2013-10-25 15:54:40 +00:00
< / tr >
2014-03-28 01:42:49 +00:00
< / tbody >
< / table >
2013-10-25 15:54:40 +00:00
2014-03-28 01:42:49 +00:00
< dl class = "details" >
2013-10-25 16:30:37 +00:00
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "Body.js.html" > physics/arcade/Body.js< / a > , < a href = "Body.js.html#sunlight-1-line-549" > line 549< / a >
2013-10-25 16:30:37 +00:00
< / li > < / ul > < / dd >
< / dl >
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
< / dd >
< dt >
< h4 class = "name" id = "updateBounds" > < span class = "type-signature" > < protected> < / span > updateBounds< span class = "signature" > ()< / span > < span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Internal method.< / p >
< / div >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "Body.js.html" > physics/arcade/Body.js< / a > , < a href = "Body.js.html#sunlight-1-line-328" > line 328< / a >
2014-03-14 06:36:05 +00:00
< / li > < / ul > < / dd >
< / dl >
2013-10-25 15:54:40 +00:00
< / dd >
< dt >
< h4 class = "name" id = "updateMotion" > < span class = "type-signature" > < / span > updateMotion< span class = "signature" > (The)< / span > < span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Called automatically by a Physics body, it updates all motion related values on the Body.< / p >
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > The< / code > < / td >
< td class = "type" >
2014-03-14 06:36:05 +00:00
< span class = "param-type" > < a href = "Phaser.Physics.Arcade.Body.html" > Phaser.Physics.Arcade.Body< / a > < / span >
2013-10-25 15:54:40 +00:00
< / td >
< td class = "description last" > < p > Body object to be updated.< / p > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-24 12:41:45 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-253" > line 253< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "velocityFromAngle" > < span class = "type-signature" > < / span > velocityFromAngle< span class = "signature" > (angle, < span class = "optional" > speed< / span > , < span class = "optional" > point< / span > )< / span > < span class = "type-signature" > → {< a href = "Phaser.Point.html" > Phaser.Point< / a > }< / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Given the angle (in degrees) and speed calculate the velocity and return it as a Point object, or set it to the given point object.
One way to use this is: velocityFromAngle(angle, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object.< / p >
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th > Argument< / th >
< th > Default< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > angle< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "default" >
< / td >
< td class = "description last" > < p > The angle in degrees calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative)< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > speed< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
60
< / td >
< td class = "description last" > < p > The speed it will move, in pixels per second sq.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > point< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "Phaser.Point.html" > Phaser.Point< / a > < / span >
|
< span class = "param-type" > object< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
< / td >
< td class = "description last" > < p > The Point object in which the x and y properties will be set to the calculated velocity.< / p > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-1422" > line 1422< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
< ul >
< li > A Point where point.x contains the velocity x value and point.y contains the velocity y value.< / li >
< / ul >
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > < a href = "Phaser.Point.html" > Phaser.Point< / a > < / span >
< / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "velocityFromRotation" > < span class = "type-signature" > < / span > velocityFromRotation< span class = "signature" > (rotation, < span class = "optional" > speed< / span > , < span class = "optional" > point< / span > )< / span > < span class = "type-signature" > → {< a href = "Phaser.Point.html" > Phaser.Point< / a > }< / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Given the rotation (in radians) and speed calculate the velocity and return it as a Point object, or set it to the given point object.
One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object.< / p >
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th > Argument< / th >
< th > Default< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > rotation< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "default" >
< / td >
< td class = "description last" > < p > The angle in radians.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > speed< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
60
< / td >
< td class = "description last" > < p > The speed it will move, in pixels per second sq.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > point< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "Phaser.Point.html" > Phaser.Point< / a > < / span >
|
< span class = "param-type" > object< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
< / td >
< td class = "description last" > < p > The Point object in which the x and y properties will be set to the calculated velocity.< / p > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2014-03-28 01:42:49 +00:00
< a href = "World.js_.html" > physics/arcade/World.js< / a > , < a href = "World.js_.html#sunlight-1-line-1441" > line 1441< / a >
2013-10-25 15:54:40 +00:00
< / li > < / ul > < / dd >
< / dl >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
< ul >
< li > A Point where point.x contains the velocity x value and point.y contains the velocity y value.< / li >
< / ul >
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > < a href = "Phaser.Point.html" > Phaser.Point< / a > < / span >
< / dd >
< / dl >
< / dd >
< / dl >
< / article >
< / section >
< / div >
< div class = "clearfix" > < / div >
< footer >
< span class = "copyright" >
2014-02-05 06:29:17 +00:00
Phaser Copyright © 2012-2014 Photon Storm Ltd.
2013-10-25 15:54:40 +00:00
< / span >
< br / >
< span class = "jsdoc-message" >
Documentation generated by < a href = "https://github.com/jsdoc3/jsdoc" > JSDoc 3.3.0-dev< / a >
2014-03-28 01:42:49 +00:00
on Fri Mar 28 2014 01:41:32 GMT-0000 (GMT) using the < a href = "https://github.com/terryweiss/docstrap" > DocStrap template< / a > .
2013-10-25 15:54:40 +00:00
< / span >
< / footer >
< / div >
< div class = "span3" >
< div id = "toc" > < / div >
< / 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-03-14 06:36:05 +00:00
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
2013-10-25 15:54:40 +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 >