2013-10-03 01:38:35 +00:00
<!DOCTYPE html>
< html lang = "en" >
< head >
< meta charset = "utf-8" >
2014-11-15 20:01:46 +00:00
< title > Phaser Source: D:/wamp/www/phaser/src/tween/Tween.js< / title >
2013-10-03 01:38:35 +00:00
<!-- [if lt IE 9]>
< script src = "//html5shiv.googlecode.com/svn/trunk/html5.js" > < / script >
<![endif]-->
2014-11-15 20:01:46 +00:00
< link type = "text/css" rel = "stylesheet" href = "styles/default.css" >
2013-10-03 01:38:35 +00:00
< link type = "text/css" rel = "stylesheet" href = "styles/sunlight.default.css" >
< link type = "text/css" rel = "stylesheet" href = "styles/site.cerulean.css" >
< / head >
< body >
< 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 " >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-0" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.html" > Phaser< / a >
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-0" >
< a href = "PIXI.html" > PIXI< / a >
< / li >
2013-10-03 01:38:35 +00:00
< / ul >
< / li >
< li class = "dropdown" >
< a href = "classes.list.html" class = "dropdown-toggle" data-toggle = "dropdown" > Classes< b
class="caret">< / b > < / a >
< ul class = "dropdown-menu " >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Animation.html" > Animation< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.AnimationManager.html" > AnimationManager< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.AnimationParser.html" > AnimationParser< / a >
< / li >
2014-04-29 14:39:02 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.ArrayList.html" > ArrayList< / a >
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.ArrayUtils.html" > ArrayUtils< / a >
< / li >
2014-10-09 15:12:53 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.AudioSprite.html" > AudioSprite< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.BitmapData.html" > BitmapData< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.BitmapText.html" > BitmapText< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Button.html" > Button< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Cache.html" > Cache< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Camera.html" > Camera< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Canvas.html" > Canvas< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Circle.html" > Circle< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Color.html" > Color< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Device.html" > Device< / a >
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.DOM.html" > DOM< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Easing.html" > Easing< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Easing.Back.html" > Back< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Easing.Bounce.html" > Bounce< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Easing.Circular.html" > Circular< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Easing.Cubic.html" > Cubic< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Easing.Elastic.html" > Elastic< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Easing.Exponential.html" > Exponential< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Easing.Linear.html" > Linear< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Easing.Quadratic.html" > Quadratic< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Easing.Quartic.html" > Quartic< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Easing.Quintic.html" > Quintic< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Easing.Sinusoidal.html" > Sinusoidal< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-18 03:01:51 +00:00
< a href = "Phaser.Ellipse.html" > Ellipse< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Events.html" > Events< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.Filter.html" > Filter< / a >
< / li >
2014-09-09 14:36:56 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.FlexGrid.html" > FlexGrid< / a >
< / li >
< li class = "class-depth-1" >
< a href = "Phaser.FlexLayer.html" > FlexLayer< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Frame.html" > Frame< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.FrameData.html" > FrameData< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Game.html" > Game< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-21 15:37:26 +00:00
< a href = "Phaser.GameObjectCreator.html" > GameObjectCreator< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.GameObjectFactory.html" > GameObjectFactory< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-05 06:29:17 +00:00
< a href = "Phaser.Gamepad.html" > Gamepad< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-05 06:29:17 +00:00
< a href = "Phaser.GamepadButton.html" > GamepadButton< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Graphics.html" > Graphics< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Group.html" > Group< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-08 07:24:22 +00:00
< a href = "Phaser.Image.html" > Image< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Input.html" > Input< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.InputHandler.html" > InputHandler< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Key.html" > Key< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Keyboard.html" > Keyboard< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-05 06:29:17 +00:00
< a href = "Phaser.Line.html" > Line< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.LinkedList.html" > LinkedList< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Loader.html" > Loader< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.LoaderParser.html" > LoaderParser< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Math.html" > Math< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Mouse.html" > Mouse< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.MSPointer.html" > MSPointer< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Net.html" > Net< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.Particle.html" > Particle< / a >
< / li >
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Particles.html" > Particles< / a >
< / li >
2014-10-09 15:12:53 +00:00
< li class = "class-depth-2" >
< a href = "Phaser.Particles.Arcade.html" > Arcade< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Particles.Arcade.Emitter.html" > Emitter< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Physics.html" > Physics< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Physics.Arcade.html" > Arcade< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.Arcade.Body.html" > Body< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.Ninja.html" > Ninja< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.Ninja.AABB.html" > AABB< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.Ninja.Body.html" > Body< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.Ninja.Circle.html" > Circle< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.Ninja.Tile.html" > Tile< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.html" > P2< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.Body.html" > Body< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.BodyDebug.html" > BodyDebug< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.CollisionGroup.html" > CollisionGroup< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.ContactMaterial.html" > ContactMaterial< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.DistanceConstraint.html" > DistanceConstraint< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-11 12:09:28 +00:00
< li class = "class-depth-3" >
< a href = "Phaser.Physics.P2.FixtureList.html" > FixtureList< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.GearConstraint.html" > GearConstraint< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.InversePointProxy.html" > InversePointProxy< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.LockConstraint.html" > LockConstraint< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.Material.html" > Material< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.PointProxy.html" > PointProxy< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.PrismaticConstraint.html" > PrismaticConstraint< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.RevoluteConstraint.html" > RevoluteConstraint< / a >
< / li >
2014-09-09 14:36:56 +00:00
< li class = "class-depth-3" >
< a href = "Phaser.Physics.P2.RotationalSpring.html" > RotationalSpring< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.Spring.html" > Spring< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Plugin.html" > Plugin< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.PluginManager.html" > PluginManager< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Point.html" > Point< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Pointer.html" > Pointer< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-07 06:10:15 +00:00
< a href = "Phaser.Polygon.html" > Polygon< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.QuadTree.html" > QuadTree< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.RandomDataGenerator.html" > RandomDataGenerator< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Rectangle.html" > Rectangle< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.RenderTexture.html" > RenderTexture< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.RequestAnimationFrame.html" > RequestAnimationFrame< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.RetroFont.html" > RetroFont< / a >
< / li >
2014-09-09 14:36:56 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.Rope.html" > Rope< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.ScaleManager.html" > ScaleManager< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Signal.html" > Signal< / a >
< / li >
2014-04-11 12:09:28 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.SignalBinding.html" > SignalBinding< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-05 06:29:17 +00:00
< a href = "Phaser.SinglePad.html" > SinglePad< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Sound.html" > Sound< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.SoundManager.html" > SoundManager< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Sprite.html" > Sprite< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-18 03:01:51 +00:00
< a href = "Phaser.SpriteBatch.html" > SpriteBatch< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Stage.html" > Stage< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.State.html" > State< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.StateManager.html" > StateManager< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Text.html" > Text< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.Tile.html" > Tile< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.Tilemap.html" > Tilemap< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.TilemapLayer.html" > TilemapLayer< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.TilemapParser.html" > TilemapParser< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.Tileset.html" > Tileset< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.TileSprite.html" > TileSprite< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Time.html" > Time< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.Timer.html" > Timer< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-05 06:29:17 +00:00
< a href = "Phaser.TimerEvent.html" > TimerEvent< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Touch.html" > Touch< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Tween.html" > Tween< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.TweenManager.html" > TweenManager< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Utils.html" > Utils< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.Utils.Debug.html" > Debug< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-03 01:38:35 +00:00
< a href = "Phaser.World.html" > World< / a >
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-1" >
< a href = "PIXI.AbstractFilter.html" > AbstractFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.AjaxRequest.html" > AjaxRequest< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.AlphaMaskFilter.html" > AlphaMaskFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.AsciiFilter.html" > AsciiFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.AssetLoader.html" > AssetLoader< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.AtlasLoader.html" > AtlasLoader< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.BaseTexture.html" > BaseTexture< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.BitmapFontLoader.html" > BitmapFontLoader< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.BitmapText.html" > BitmapText< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.BlurFilter.html" > BlurFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.BlurXFilter.html" > BlurXFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.BlurYFilter.html" > BlurYFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.CanvasBuffer.html" > CanvasBuffer< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.CanvasGraphics.html" > CanvasGraphics< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.CanvasMaskManager.html" > CanvasMaskManager< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.CanvasRenderer.html" > CanvasRenderer< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.CanvasTinter.html" > CanvasTinter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.Circle.html" > Circle< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.ColorMatrixFilter.html" > ColorMatrixFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.ColorStepFilter.html" > ColorStepFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.ComplexPrimitiveShader.html" > ComplexPrimitiveShader< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.ConvolutionFilter.html" > ConvolutionFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.CrossHatchFilter.html" > CrossHatchFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.DisplacementFilter.html" > DisplacementFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.DisplayObject.html" > DisplayObject< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.DisplayObjectContainer.html" > DisplayObjectContainer< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.DotScreenFilter.html" > DotScreenFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.Ellipse.html" > Ellipse< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.Event.html" > Event< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.EventTarget.html" > EventTarget< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.FilterBlock.html" > FilterBlock< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.FilterTexture.html" > FilterTexture< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.Graphics.html" > Graphics< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.GraphicsData.html" > GraphicsData< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.GrayFilter.html" > GrayFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.ImageLoader.html" > ImageLoader< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.InteractionData.html" > InteractionData< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.InteractionManager.html" > InteractionManager< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.InvertFilter.html" > InvertFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.JsonLoader.html" > JsonLoader< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.Matrix.html" > Matrix< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.MovieClip.html" > MovieClip< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.NoiseFilter.html" > NoiseFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.NormalMapFilter.html" > NormalMapFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.PixelateFilter.html" > PixelateFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.PIXI.html" > PIXI< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.PixiFastShader.html" > PixiFastShader< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.PixiShader.html" > PixiShader< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.Point.html" > Point< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.Polygon.html" > Polygon< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.PolyK.html" > PolyK< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.PrimitiveShader.html" > PrimitiveShader< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.Rectangle.html" > Rectangle< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.RenderTexture.html" > RenderTexture< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.RGBSplitFilter.html" > RGBSplitFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.Rope.html" > Rope< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.RoundedRectangle.html" > RoundedRectangle< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.SepiaFilter.html" > SepiaFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.SmartBlurFilter.html" > SmartBlurFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.Spine.html" > Spine< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.SpineLoader.html" > SpineLoader< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.Sprite.html" > Sprite< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.SpriteBatch.html" > SpriteBatch< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.SpriteSheetLoader.html" > SpriteSheetLoader< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.Stage.html" > Stage< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.Strip.html" > Strip< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.StripShader.html" > StripShader< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.Text.html" > Text< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.Texture.html" > Texture< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.TilingSprite.html" > TilingSprite< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.TiltShiftFilter.html" > TiltShiftFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.TiltShiftXFilter.html" > TiltShiftXFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.TiltShiftYFilter.html" > TiltShiftYFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.TwistFilter.html" > TwistFilter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.VideoTexture.html" > VideoTexture< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.WebGLBlendModeManager.html" > WebGLBlendModeManager< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.WebGLFastSpriteBatch.html" > WebGLFastSpriteBatch< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.WebGLFilterManager.html" > WebGLFilterManager< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.WebGLRenderer.html" > WebGLRenderer< / a >
< / li >
2013-10-03 01:38:35 +00:00
< / ul >
< / li >
2014-11-15 20:01:46 +00:00
< li class = "dropdown" >
< a href = "global.html" class = "dropdown-toggle" data-toggle = "dropdown" > Global< b
class="caret">< / b > < / a >
< ul class = "dropdown-menu " >
< li class = "class-depth-0" >
< a href = "global.html#clone" > clone< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#createCustomLayer" > createCustomLayer< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#createFixedLayer" > createFixedLayer< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#createFluidLayer" > createFluidLayer< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#createFullLayer" > createFullLayer< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#debug" > debug< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#destroy" > destroy< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#onResize" > onResize< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#originalEvent" > originalEvent< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#refresh" > refresh< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#reset" > reset< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#setSize" > setSize< / a >
< / li >
< / ul >
< / li >
2014-09-09 14:36:56 +00:00
2013-10-03 01:38:35 +00:00
< / ul >
< / div >
< / div >
< div class = "row-fluid" >
< div class = "span12" >
< div id = "main" >
2014-11-15 20:01:46 +00:00
< h1 class = "page-title" > Source: D:/wamp/www/phaser/src/tween/Tween.js< / h1 >
2013-10-03 01:38:35 +00:00
< section >
< article >
< pre class = "sunlight-highlight-javascript linenums" > /**
* @author Richard Davey < rich@photonstorm.com>
2014-02-05 06:29:17 +00:00
* @copyright 2014 Photon Storm Ltd.
2013-10-03 01:38:35 +00:00
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* Tween constructor
* Create a new < code>Tween< /code>.
*
* @class Phaser.Tween
* @constructor
* @param {object} object - Target object will be affected by this tween.
* @param {Phaser.Game} game - Current game instance.
2014-03-14 06:36:05 +00:00
* @param {Phaser.TweenManager} manager - The TweenManager responsible for looking after this Tween.
2013-10-03 01:38:35 +00:00
*/
2014-03-14 06:36:05 +00:00
Phaser.Tween = function (object, game, manager) {
2013-10-03 01:38:35 +00:00
/**
* Reference to the target object.
* @property {object} _object
* @private
*/
2013-11-28 15:57:09 +00:00
this._object = object;
2013-10-03 01:38:35 +00:00
/**
* @property {Phaser.Game} game - A reference to the currently running Game.
*/
this.game = game;
/**
2014-02-05 06:29:17 +00:00
* @property {Phaser.TweenManager} _manager - Reference to the TweenManager.
2013-10-03 01:38:35 +00:00
* @private
*/
2014-03-14 06:36:05 +00:00
this._manager = manager;
2013-10-03 01:38:35 +00:00
/**
2014-02-05 06:29:17 +00:00
* @property {object} _valuesStart - Private value object.
2013-10-03 01:38:35 +00:00
* @private
*/
this._valuesStart = {};
/**
2014-02-05 06:29:17 +00:00
* @property {object} _valuesEnd - Private value object.
2013-10-03 01:38:35 +00:00
* @private
*/
this._valuesEnd = {};
/**
2014-02-05 06:29:17 +00:00
* @property {object} _valuesStartRepeat - Private value object.
2013-10-03 01:38:35 +00:00
* @private
*/
this._valuesStartRepeat = {};
/**
2014-02-05 06:29:17 +00:00
* @property {number} _duration - Private duration counter.
2013-10-03 01:38:35 +00:00
* @private
* @default
*/
this._duration = 1000;
/**
2014-02-05 06:29:17 +00:00
* @property {number} _repeat - Private repeat counter.
2013-10-03 01:38:35 +00:00
* @private
* @default
*/
this._repeat = 0;
/**
2014-02-05 06:29:17 +00:00
* @property {boolean} _yoyo - Private yoyo flag.
2013-10-03 01:38:35 +00:00
* @private
* @default
*/
this._yoyo = false;
/**
2014-02-05 06:29:17 +00:00
* @property {boolean} _reversed - Private reversed flag.
2013-10-03 01:38:35 +00:00
* @private
* @default
*/
this._reversed = false;
/**
2014-02-05 06:29:17 +00:00
* @property {number} _delayTime - Private delay counter.
2013-10-03 01:38:35 +00:00
* @private
* @default
*/
this._delayTime = 0;
/**
2014-02-05 06:29:17 +00:00
* @property {number} _startTime - Private start time counter.
2013-10-03 01:38:35 +00:00
* @private
* @default null
*/
this._startTime = null;
/**
2014-02-05 06:29:17 +00:00
* @property {function} _easingFunction - The easing function used for the tween.
2013-10-03 01:38:35 +00:00
* @private
*/
2014-09-09 14:36:56 +00:00
this._easingFunction = Phaser.Easing.Default;
2013-10-03 01:38:35 +00:00
/**
2014-02-05 06:29:17 +00:00
* @property {function} _interpolationFunction - The interpolation function used for the tween.
2013-10-03 01:38:35 +00:00
* @private
*/
this._interpolationFunction = Phaser.Math.linearInterpolation;
/**
2014-02-05 06:29:17 +00:00
* @property {array} _chainedTweens - A private array of chained tweens.
2013-10-03 01:38:35 +00:00
* @private
*/
this._chainedTweens = [];
/**
2014-02-05 06:29:17 +00:00
* @property {boolean} _onStartCallbackFired - Private flag.
2013-10-03 01:38:35 +00:00
* @private
* @default
*/
this._onStartCallbackFired = false;
/**
2014-02-05 06:29:17 +00:00
* @property {function} _onUpdateCallback - An onUpdate callback.
2013-10-03 01:38:35 +00:00
* @private
* @default null
*/
this._onUpdateCallback = null;
2014-03-28 01:42:49 +00:00
2013-10-03 01:38:35 +00:00
/**
2014-02-05 06:29:17 +00:00
* @property {object} _onUpdateCallbackContext - The context in which to call the onUpdate callback.
2013-10-03 01:38:35 +00:00
* @private
* @default null
*/
2014-02-05 06:29:17 +00:00
this._onUpdateCallbackContext = null;
2014-03-14 06:36:05 +00:00
/**
* @property {boolean} _paused - Is this Tween paused or not?
* @private
* @default
*/
this._paused = false;
2013-10-03 01:38:35 +00:00
/**
2014-02-05 06:29:17 +00:00
* @property {number} _pausedTime - Private pause timer.
2013-10-03 01:38:35 +00:00
* @private
* @default
*/
this._pausedTime = 0;
2014-03-14 06:36:05 +00:00
/**
* @property {boolean} _codePaused - Was the Tween paused by code or by Game focus loss?
* @private
*/
this._codePaused = false;
2013-10-03 01:38:35 +00:00
/**
* @property {boolean} pendingDelete - If this tween is ready to be deleted by the TweenManager.
* @default
*/
this.pendingDelete = false;
/**
2014-02-05 06:29:17 +00:00
* @property {Phaser.Signal} onStart - The onStart event is fired when the Tween begins.
2013-10-03 01:38:35 +00:00
*/
this.onStart = new Phaser.Signal();
/**
2014-02-05 06:29:17 +00:00
* @property {Phaser.Signal} onLoop - The onLoop event is fired if the Tween loops.
*/
this.onLoop = new Phaser.Signal();
/**
* @property {Phaser.Signal} onComplete - The onComplete event is fired when the Tween completes. Does not fire if the Tween is set to loop.
2013-10-03 01:38:35 +00:00
*/
this.onComplete = new Phaser.Signal();
/**
2014-02-05 06:29:17 +00:00
* @property {boolean} isRunning - If the tween is running this is set to true, otherwise false. Tweens that are in a delayed state, waiting to start, are considered as being running.
2013-10-03 01:38:35 +00:00
* @default
*/
this.isRunning = false;
};
Phaser.Tween.prototype = {
2013-11-28 15:57:09 +00:00
/**
2014-07-10 19:31:11 +00:00
* Sets this tween to be a `to` tween on the properties given. A `to` tween starts at the current value and tweens to the destination value given.
* For example a Sprite with an `x` coordinate of 100 could be tweened to `x` 200 by giving a properties object of `{ x: 200 }`.
2013-11-28 15:57:09 +00:00
*
* @method Phaser.Tween#to
2014-07-10 19:31:11 +00:00
* @param {object} properties - The properties you want to tween, such as `Sprite.x` or `Sound.volume`. Given as a JavaScript object.
2014-02-05 06:29:17 +00:00
* @param {number} [duration=1000] - Duration of this tween in ms.
2014-09-09 14:36:56 +00:00
* @param {function} [ease=null] - Easing function. If not set it will default to Phaser.Easing.Default, which is Phaser.Easing.Linear.None by default but can be over-ridden at will.
2014-02-05 06:29:17 +00:00
* @param {boolean} [autoStart=false] - Whether this tween will start automatically or not.
* @param {number} [delay=0] - Delay before this tween will start, defaults to 0 (no delay). Value given is in ms.
2014-03-24 12:41:45 +00:00
* @param {number} [repeat=0] - Should the tween automatically restart once complete? If you want it to run forever set as Number.MAX_VALUE. This ignores any chained tweens.
2014-04-10 22:13:43 +00:00
* @param {boolean} [yoyo=false] - A tween that yoyos will reverse itself and play backwards automatically. A yoyo'd tween doesn't fire the Tween.onComplete event, so listen for Tween.onLoop instead.
2014-02-05 06:29:17 +00:00
* @return {Phaser.Tween} This Tween object.
2013-11-28 15:57:09 +00:00
*/
2014-02-05 06:29:17 +00:00
to: function (properties, duration, ease, autoStart, delay, repeat, yoyo) {
2013-11-28 15:57:09 +00:00
duration = duration || 1000;
ease = ease || null;
autoStart = autoStart || false;
delay = delay || 0;
repeat = repeat || 0;
yoyo = yoyo || false;
2014-04-29 14:39:02 +00:00
if (yoyo & & repeat === 0)
{
repeat = 1;
}
2013-11-28 15:57:09 +00:00
var self;
2014-02-05 06:29:17 +00:00
2014-11-15 20:01:46 +00:00
if (this._parent & & this._parent !== this)
2013-11-28 15:57:09 +00:00
{
self = this._manager.create(this._object);
this._lastChild.chain(self);
this._lastChild = self;
}
else
{
self = this;
this._parent = this;
this._lastChild = this;
}
self._repeat = repeat;
2013-10-03 01:38:35 +00:00
self._duration = duration;
2013-11-28 15:57:09 +00:00
self._valuesEnd = properties;
2013-10-03 01:38:35 +00:00
if (ease !== null)
{
self._easingFunction = ease;
}
if (delay > 0)
{
self._delayTime = delay;
}
2014-11-15 20:01:46 +00:00
else
{
self._delayTime = 0;
}
2013-10-03 01:38:35 +00:00
self._yoyo = yoyo;
2014-02-05 06:29:17 +00:00
if (autoStart)
{
2013-10-23 13:00:28 +00:00
return this.start();
2014-02-05 06:29:17 +00:00
}
else
{
2013-10-23 13:00:28 +00:00
return this;
2013-10-03 01:38:35 +00:00
}
2013-11-28 15:57:09 +00:00
},
2013-10-03 01:38:35 +00:00
2014-05-20 09:12:48 +00:00
/**
2014-07-10 19:31:11 +00:00
* Sets this tween to be a `from` tween on the properties given. A `from` tween starts at the given value and tweens to the current values.
* For example a Sprite with an `x` coordinate of 100 could be tweened from `x: 200` by giving a properties object of `{ x: 200 }`.
2014-05-20 09:12:48 +00:00
*
* @method Phaser.Tween#from
* @param {object} properties - Properties you want to tween from.
* @param {number} [duration=1000] - Duration of this tween in ms.
* @param {function} [ease=null] - Easing function. If not set it will default to Phaser.Easing.Linear.None.
* @param {boolean} [autoStart=false] - Whether this tween will start automatically or not.
* @param {number} [delay=0] - Delay before this tween will start, defaults to 0 (no delay). Value given is in ms.
* @param {number} [repeat=0] - Should the tween automatically restart once complete? If you want it to run forever set as Number.MAX_VALUE. This ignores any chained tweens.
* @param {boolean} [yoyo=false] - A tween that yoyos will reverse itself and play backwards automatically. A yoyo'd tween doesn't fire the Tween.onComplete event, so listen for Tween.onLoop instead.
* @return {Phaser.Tween} This Tween object.
*/
from: function(properties, duration, ease, autoStart, delay, repeat, yoyo) {
2014-07-10 19:31:11 +00:00
2014-05-20 09:12:48 +00:00
var _cache = {};
2014-07-10 19:31:11 +00:00
for (var prop in properties)
{
_cache[prop] = this._object[prop];
this._object[prop] = properties[prop];
2014-05-20 09:12:48 +00:00
}
2014-07-10 19:31:11 +00:00
return this.to(_cache, duration, ease, autoStart, delay, repeat, yoyo);
2014-05-20 09:12:48 +00:00
},
2013-11-28 15:57:09 +00:00
/**
2014-11-15 20:01:46 +00:00
* Starts the tween running. Can also be called by the autoStart parameter of `Tween.to.`
2013-11-28 15:57:09 +00:00
*
* @method Phaser.Tween#start
2014-11-15 20:01:46 +00:00
* @return {Phaser.Tween} This tween. Useful for method chaining.
2013-11-28 15:57:09 +00:00
*/
start: function () {
2013-10-03 01:38:35 +00:00
2014-02-05 06:29:17 +00:00
if (this.game === null || this._object === null)
{
2013-10-03 01:38:35 +00:00
return;
}
2013-11-28 15:57:09 +00:00
this._manager.add(this);
2013-10-03 01:38:35 +00:00
this.isRunning = true;
2013-11-28 15:57:09 +00:00
this._onStartCallbackFired = false;
2013-10-03 01:38:35 +00:00
2014-11-15 20:01:46 +00:00
// delays before the tween start are also affected by the time.slowMotion factor
// TODO: if the slowMotion factor changes during the delay, this will continue to use the original value until the delay expires!
this._startTime = this.game.time.now + this._delayTime * this.game.time.slowMotion;
2013-10-03 01:38:35 +00:00
2014-02-05 06:29:17 +00:00
for (var property in this._valuesEnd)
{
2013-11-28 15:57:09 +00:00
// check if an Array was provided as property value
2014-03-14 06:36:05 +00:00
if (Array.isArray(this._valuesEnd[property]))
2014-02-05 06:29:17 +00:00
{
if (this._valuesEnd[property].length === 0)
{
2013-11-28 15:57:09 +00:00
continue;
}
2013-10-03 01:38:35 +00:00
2013-11-28 15:57:09 +00:00
// create a local copy of the Array with the start value at the front
2014-02-05 06:29:17 +00:00
this._valuesEnd[property] = [this._object[property]].concat(this._valuesEnd[property]);
2013-11-28 15:57:09 +00:00
}
2013-10-03 01:38:35 +00:00
2014-02-05 06:29:17 +00:00
this._valuesStart[property] = this._object[property];
2013-10-03 01:38:35 +00:00
2014-03-14 06:36:05 +00:00
if (!Array.isArray(this._valuesStart[property]))
2014-02-05 06:29:17 +00:00
{
this._valuesStart[property] *= 1.0; // Ensures we're using numbers, not strings
2013-11-28 15:57:09 +00:00
}
2013-10-03 01:38:35 +00:00
2014-02-05 06:29:17 +00:00
this._valuesStartRepeat[property] = this._valuesStart[property] || 0;
2013-11-28 15:57:09 +00:00
}
2013-10-03 01:38:35 +00:00
2013-11-28 15:57:09 +00:00
return this;
2013-10-03 01:38:35 +00:00
2013-11-28 15:57:09 +00:00
},
2013-10-03 01:38:35 +00:00
2014-03-14 06:36:05 +00:00
/**
* This will generate an array populated with the tweened object values from start to end.
* It works by running the tween simulation at the given frame rate based on the values set-up in Tween.to and similar functions.
* It ignores delay and repeat counts and any chained tweens. Just one play through of tween data is returned, including yoyo if set.
*
* @method Phaser.Tween#generateData
* @param {number} [frameRate=60] - The speed in frames per second that the data should be generated at. The higher the value, the larger the array it creates.
* @param {array} [data] - If given the generated data will be appended to this array, otherwise a new array will be returned.
* @return {array} An array of tweened values.
*/
generateData: function (frameRate, data) {
if (this.game === null || this._object === null)
{
return null;
}
this._startTime = 0;
for (var property in this._valuesEnd)
{
// Check if an Array was provided as property value
if (Array.isArray(this._valuesEnd[property]))
{
if (this._valuesEnd[property].length === 0)
{
continue;
}
// create a local copy of the Array with the start value at the front
this._valuesEnd[property] = [this._object[property]].concat(this._valuesEnd[property]);
}
this._valuesStart[property] = this._object[property];
if (!Array.isArray(this._valuesStart[property]))
{
this._valuesStart[property] *= 1.0; // Ensures we're using numbers, not strings
}
this._valuesStartRepeat[property] = this._valuesStart[property] || 0;
}
// Simulate the tween. We will run for frameRate * (this._duration / 1000) (ms)
var time = 0;
2014-03-28 01:42:49 +00:00
var total = Math.floor(frameRate * (this._duration / 1000));
2014-03-14 06:36:05 +00:00
var tick = this._duration / total;
var output = [];
while (total--)
{
var property;
2014-11-15 20:01:46 +00:00
var percent = (time - this._startTime) / this._duration;
percent = percent > 1 ? 1 : percent;
2014-03-14 06:36:05 +00:00
2014-11-15 20:01:46 +00:00
var value = this._easingFunction(percent);
2014-03-14 06:36:05 +00:00
var blob = {};
for (property in this._valuesEnd)
{
var start = this._valuesStart[property] || 0;
var end = this._valuesEnd[property];
if (end instanceof Array)
{
blob[property] = this._interpolationFunction(end, value);
}
else
{
2014-09-09 14:36:56 +00:00
if (typeof end === 'string')
2014-03-14 06:36:05 +00:00
{
2014-09-09 14:36:56 +00:00
// Parses relative end values with start as base (e.g.: +10, -3)
2014-03-14 06:36:05 +00:00
end = start + parseFloat(end, 10);
}
2014-09-09 14:36:56 +00:00
else if (typeof end === 'number')
2014-03-14 06:36:05 +00:00
{
2014-09-09 14:36:56 +00:00
// Protect against non numeric properties.
blob[property] = start + (end - start) * value;
2014-03-14 06:36:05 +00:00
}
}
}
output.push(blob);
time += tick;
}
2014-09-09 14:36:56 +00:00
var blob = {};
for (property in this._valuesEnd)
{
blob[property] = this._valuesEnd[property];
}
output.push(blob);
2014-03-14 06:36:05 +00:00
if (this._yoyo)
{
var reversed = output.slice();
reversed.reverse();
output = output.concat(reversed);
}
if (typeof data !== 'undefined')
{
data = data.concat(output);
return data;
}
else
{
return output;
}
},
2013-11-28 15:57:09 +00:00
/**
2014-11-15 20:01:46 +00:00
* Stops the tween if running and removes it from the TweenManager.
* If called directly and there are any `onComplete` callbacks or events they are not dispatched.
2013-11-28 15:57:09 +00:00
*
* @method Phaser.Tween#stop
2014-11-15 20:01:46 +00:00
* @return {Phaser.Tween} This tween. Useful for method chaining.
2013-11-28 15:57:09 +00:00
*/
stop: function () {
2013-10-03 01:38:35 +00:00
this.isRunning = false;
2014-02-05 06:29:17 +00:00
this._onUpdateCallback = null;
2014-11-15 20:01:46 +00:00
this._onStartCallbackFired = false;
2014-02-05 06:29:17 +00:00
2013-11-28 15:57:09 +00:00
this._manager.remove(this);
return this;
},
/**
* Sets a delay time before this tween will start.
*
* @method Phaser.Tween#delay
* @param {number} amount - The amount of the delay in ms.
2014-11-15 20:01:46 +00:00
* @return {Phaser.Tween} This tween. Useful for method chaining.
2013-11-28 15:57:09 +00:00
*/
2014-02-05 06:29:17 +00:00
delay: function (amount) {
2013-11-28 15:57:09 +00:00
this._delayTime = amount;
2014-11-15 20:01:46 +00:00
2013-11-28 15:57:09 +00:00
return this;
},
/**
* Sets the number of times this tween will repeat.
*
* @method Phaser.Tween#repeat
* @param {number} times - How many times to repeat.
2014-11-15 20:01:46 +00:00
* @return {Phaser.Tween} This tween. Useful for method chaining.
2013-11-28 15:57:09 +00:00
*/
2014-02-05 06:29:17 +00:00
repeat: function (times) {
2013-11-28 15:57:09 +00:00
this._repeat = times;
2014-04-29 14:39:02 +00:00
2013-11-28 15:57:09 +00:00
return this;
},
/**
* A tween that has yoyo set to true will run through from start to finish, then reverse from finish to start.
* Used in combination with repeat you can create endless loops.
*
* @method Phaser.Tween#yoyo
* @param {boolean} yoyo - Set to true to yoyo this tween.
2014-11-15 20:01:46 +00:00
* @return {Phaser.Tween} This tween. Useful for method chaining.
2013-11-28 15:57:09 +00:00
*/
2014-02-05 06:29:17 +00:00
yoyo: function(yoyo) {
2013-11-28 15:57:09 +00:00
this._yoyo = yoyo;
2014-04-29 14:39:02 +00:00
if (yoyo & & this._repeat === 0)
{
this._repeat = 1;
}
2013-11-28 15:57:09 +00:00
return this;
},
/**
2014-03-28 01:42:49 +00:00
* Set easing function this tween will use, i.e. Phaser.Easing.Linear.None.
2013-11-28 15:57:09 +00:00
*
* @method Phaser.Tween#easing
* @param {function} easing - The easing function this tween will use, i.e. Phaser.Easing.Linear.None.
2014-11-15 20:01:46 +00:00
* @return {Phaser.Tween} This tween. Useful for method chaining.
2013-11-28 15:57:09 +00:00
*/
2014-02-05 06:29:17 +00:00
easing: function (easing) {
2013-11-28 15:57:09 +00:00
this._easingFunction = easing;
return this;
},
/**
* Set interpolation function the tween will use, by default it uses Phaser.Math.linearInterpolation.
2014-02-05 06:29:17 +00:00
* Also available: Phaser.Math.bezierInterpolation and Phaser.Math.catmullRomInterpolation.
2013-11-28 15:57:09 +00:00
*
* @method Phaser.Tween#interpolation
* @param {function} interpolation - The interpolation function to use (Phaser.Math.linearInterpolation by default)
2014-11-15 20:01:46 +00:00
* @return {Phaser.Tween} This tween. Useful for method chaining.
2013-11-28 15:57:09 +00:00
*/
2014-02-05 06:29:17 +00:00
interpolation: function (interpolation) {
2013-11-28 15:57:09 +00:00
this._interpolationFunction = interpolation;
return this;
},
/**
* You can chain tweens together by passing a reference to the chain function. This enables one tween to call another on completion.
* You can pass as many tweens as you like to this function, they will each be chained in sequence.
*
* @method Phaser.Tween#chain
2014-11-15 20:01:46 +00:00
* @return {Phaser.Tween} This tween. Useful for method chaining.
2013-11-28 15:57:09 +00:00
*/
chain: function () {
this._chainedTweens = arguments;
return this;
},
/**
* Loop a chain of tweens
2014-03-28 01:42:49 +00:00
*
2013-11-28 15:57:09 +00:00
* Usage:
* game.add.tween(p).to({ x: 700 }, 1000, Phaser.Easing.Linear.None, true)
* .to({ y: 300 }, 1000, Phaser.Easing.Linear.None)
* .to({ x: 0 }, 1000, Phaser.Easing.Linear.None)
* .to({ y: 0 }, 1000, Phaser.Easing.Linear.None)
* .loop();
* @method Phaser.Tween#loop
2014-11-15 20:01:46 +00:00
* @return {Phaser.Tween} This tween. Useful for method chaining.
2013-11-28 15:57:09 +00:00
*/
loop: function() {
this._lastChild.chain(this);
return this;
},
/**
2014-07-10 19:31:11 +00:00
* Sets a callback to be fired each time this tween updates.
2013-11-28 15:57:09 +00:00
*
* @method Phaser.Tween#onUpdateCallback
* @param {function} callback - The callback to invoke each time this tween is updated.
2014-07-10 19:31:11 +00:00
* @param {object} callbackContext - The context in which to call the onUpdate callback.
2014-11-15 20:01:46 +00:00
* @return {Phaser.Tween} This tween. Useful for method chaining.
2013-11-28 15:57:09 +00:00
*/
2014-02-05 06:29:17 +00:00
onUpdateCallback: function (callback, callbackContext) {
2013-11-28 15:57:09 +00:00
this._onUpdateCallback = callback;
2014-02-05 06:29:17 +00:00
this._onUpdateCallbackContext = callbackContext;
2013-11-28 15:57:09 +00:00
return this;
},
/**
2014-03-28 01:42:49 +00:00
* Pauses the tween.
2013-11-28 15:57:09 +00:00
*
* @method Phaser.Tween#pause
*/
2013-10-03 01:38:35 +00:00
pause: function () {
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
this._codePaused = true;
2013-10-03 01:38:35 +00:00
this._paused = true;
2013-10-23 13:00:28 +00:00
this._pausedTime = this.game.time.now;
2014-02-05 06:29:17 +00:00
2013-10-03 01:38:35 +00:00
},
2014-03-14 06:36:05 +00:00
/**
* This is called by the core Game loop. Do not call it directly, instead use Tween.pause.
* @method Phaser.Tween#_pause
* @private
*/
_pause: function () {
2014-03-28 01:42:49 +00:00
2014-03-14 06:36:05 +00:00
if (!this._codePaused)
{
this._paused = true;
this._pausedTime = this.game.time.now;
}
},
2013-11-28 15:57:09 +00:00
/**
* Resumes a paused tween.
*
* @method Phaser.Tween#resume
*/
2013-10-03 01:38:35 +00:00
resume: function () {
2014-02-05 06:29:17 +00:00
2014-03-14 06:36:05 +00:00
if (this._paused)
{
this._paused = false;
this._codePaused = false;
this._startTime += (this.game.time.now - this._pausedTime);
}
},
/**
* This is called by the core Game loop. Do not call it directly, instead use Tween.pause.
* @method Phaser.Tween#_resume
* @private
*/
_resume: function () {
if (this._codePaused)
{
return;
}
else
{
this._startTime += this.game.time.pauseDuration;
this._paused = false;
}
2014-02-05 06:29:17 +00:00
2013-10-03 01:38:35 +00:00
},
2013-11-28 15:57:09 +00:00
/**
* Core tween update function called by the TweenManager. Does not need to be invoked directly.
*
* @method Phaser.Tween#update
* @param {number} time - A timestamp passed in by the TweenManager.
* @return {boolean} false if the tween has completed and should be deleted from the manager, otherwise true (still active).
*/
2014-02-05 06:29:17 +00:00
update: function (time) {
2013-10-03 01:38:35 +00:00
2013-11-28 15:57:09 +00:00
if (this.pendingDelete)
{
return false;
}
2013-10-03 01:38:35 +00:00
2014-02-05 06:29:17 +00:00
if (this._paused || time < this._startTime)
{
2013-10-03 01:38:35 +00:00
return true;
}
2013-11-28 15:57:09 +00:00
var property;
2013-10-03 01:38:35 +00:00
2014-02-05 06:29:17 +00:00
if (this._onStartCallbackFired === false)
{
this.onStart.dispatch(this._object);
2013-11-28 15:57:09 +00:00
this._onStartCallbackFired = true;
}
2013-10-03 01:38:35 +00:00
2014-11-15 20:01:46 +00:00
var percent = (time - this._startTime) / (this._duration * this.game.time.slowMotion);
percent = percent > 1 ? 1 : percent;
2013-10-03 01:38:35 +00:00
2014-11-15 20:01:46 +00:00
var value = this._easingFunction(percent);
2013-10-03 01:38:35 +00:00
2014-02-05 06:29:17 +00:00
for (property in this._valuesEnd)
{
var start = this._valuesStart[property] || 0;
var end = this._valuesEnd[property];
2013-10-03 01:38:35 +00:00
2014-02-05 06:29:17 +00:00
if (end instanceof Array)
{
this._object[property] = this._interpolationFunction(end, value);
}
else
{
2013-10-03 01:38:35 +00:00
// Parses relative end values with start as base (e.g.: +10, -3)
2014-02-05 06:29:17 +00:00
if (typeof(end) === 'string')
{
2013-11-28 15:57:09 +00:00
end = start + parseFloat(end, 10);
}
2013-10-03 01:38:35 +00:00
2013-11-28 15:57:09 +00:00
// protect against non numeric properties.
2014-02-05 06:29:17 +00:00
if (typeof(end) === 'number')
{
this._object[property] = start + ( end - start ) * value;
2013-11-28 15:57:09 +00:00
}
}
}
2013-10-03 01:38:35 +00:00
2014-02-05 06:29:17 +00:00
if (this._onUpdateCallback !== null)
{
this._onUpdateCallback.call(this._onUpdateCallbackContext, this, value);
2014-07-10 19:31:11 +00:00
if (!this.isRunning)
{
return false;
}
2013-11-28 15:57:09 +00:00
}
2013-10-03 01:38:35 +00:00
2014-11-15 20:01:46 +00:00
if (percent == 1)
2014-02-05 06:29:17 +00:00
{
if (this._repeat > 0)
{
if (isFinite(this._repeat))
{
2013-11-28 15:57:09 +00:00
this._repeat--;
}
2013-10-03 01:38:35 +00:00
2013-11-28 15:57:09 +00:00
// reassign starting values, restart by making startTime = now
2014-02-05 06:29:17 +00:00
for (property in this._valuesStartRepeat)
{
if (typeof(this._valuesEnd[property]) === 'string')
{
this._valuesStartRepeat[property] = this._valuesStartRepeat[property] + parseFloat(this._valuesEnd[property], 10);
2013-11-28 15:57:09 +00:00
}
2013-10-03 01:38:35 +00:00
2014-02-05 06:29:17 +00:00
if (this._yoyo)
{
var tmp = this._valuesStartRepeat[property];
this._valuesStartRepeat[property] = this._valuesEnd[property];
this._valuesEnd[property] = tmp;
2013-11-28 15:57:09 +00:00
}
2013-10-03 01:38:35 +00:00
2014-02-05 06:29:17 +00:00
this._valuesStart[property] = this._valuesStartRepeat[property];
2013-11-28 15:57:09 +00:00
}
2013-10-03 01:38:35 +00:00
2014-05-20 09:12:48 +00:00
if (this._yoyo)
{
this._reversed = !this._reversed;
}
2013-11-28 15:57:09 +00:00
this._startTime = time + this._delayTime;
2013-10-03 01:38:35 +00:00
2014-02-05 06:29:17 +00:00
this.onLoop.dispatch(this._object);
2013-10-03 01:38:35 +00:00
2013-11-28 15:57:09 +00:00
return true;
2014-02-05 06:29:17 +00:00
}
else
{
2013-11-28 15:57:09 +00:00
this.isRunning = false;
this.onComplete.dispatch(this._object);
2013-10-03 01:38:35 +00:00
2014-02-05 06:29:17 +00:00
for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i ++)
{
this._chainedTweens[i].start(time);
2013-11-28 15:57:09 +00:00
}
2013-10-03 01:38:35 +00:00
2013-11-28 15:57:09 +00:00
return false;
}
2013-10-03 01:38:35 +00:00
2013-11-28 15:57:09 +00:00
}
2013-10-03 01:38:35 +00:00
2013-11-28 15:57:09 +00:00
return true;
2013-10-03 01:38:35 +00:00
2013-11-28 15:57:09 +00:00
}
2014-03-28 01:42:49 +00:00
2013-10-03 01:38:35 +00:00
};
2014-02-05 06:29:17 +00:00
Phaser.Tween.prototype.constructor = Phaser.Tween;
2013-10-03 01:38:35 +00:00
< / pre >
< / 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-03 01:38:35 +00:00
< / span >
< br / >
< span class = "jsdoc-message" >
2014-04-11 12:09:28 +00:00
Documentation generated by < a href = "https://github.com/jsdoc3/jsdoc" > JSDoc 3.3.0-dev< / a >
2014-11-15 20:01:46 +00:00
on Sat Nov 15 2014 19:54:26 GMT-0000 (GMT) using the < a href = "https://github.com/terryweiss/docstrap" > DocStrap template< / a > .
2013-10-03 01:38:35 +00:00
< / span >
< / footer >
< / div >
< br clear = "both" >
< / div >
< / div >
< script src = "scripts/sunlight.js" > < / script >
< script src = "scripts/sunlight.javascript.js" > < / script >
< script src = "scripts/sunlight-plugin.doclinks.js" > < / script >
< script src = "scripts/sunlight-plugin.linenumbers.js" > < / script >
< script src = "scripts/sunlight-plugin.menu.js" > < / script >
< script src = "scripts/jquery.min.js" > < / script >
< script src = "scripts/jquery.scrollTo.js" > < / script >
< script src = "scripts/jquery.localScroll.js" > < / script >
< script src = "scripts/bootstrap-dropdown.js" > < / script >
< script src = "scripts/toc.js" > < / script >
< script > Sunlight . highlightAll ( { lineNumbers : true , showMenu : true , enableDoclinks : true } ) ; < / script >
< script >
$( function () {
$( "#toc" ).toc( {
2014-04-10 22:13:43 +00:00
anchorName : function(i, heading, prefix) {
2014-03-14 06:36:05 +00:00
return $(heading).attr("id") || ( prefix + i );
},
2013-10-03 01:38:35 +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 >