2013-10-25 15:54:40 +00:00
<!DOCTYPE html>
< html lang = "en" >
< head >
< meta charset = "utf-8" >
2015-03-23 23:46:30 +00:00
< title > Phaser Source: src/pixi/primitives/Graphics.js< / title >
2013-10-25 15:54:40 +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-25 15:54:40 +00:00
< link type = "text/css" rel = "stylesheet" href = "styles/sunlight.default.css" >
< link type = "text/css" rel = "stylesheet" href = "styles/site.cerulean.css" >
< / head >
< body >
2014-11-25 00:23:44 +00:00
2013-10-25 15:54:40 +00:00
< div class = "container-fluid" >
< div class = "navbar navbar-fixed-top navbar-inverse" >
2014-11-25 00:23:44 +00:00
< div style = "position: absolute; width: 143px; height: 31px; right: 10px; top: 10px; z-index: 1050" > < a href = "http://phaser.io" > < img src = "img/phaser.png" border = "0" / > < / a > < / div >
2013-10-25 15:54:40 +00:00
< div class = "navbar-inner" >
2014-11-25 00:23:44 +00:00
< a class = "brand" href = "index.html" > Phaser API< / a >
2013-10-25 15:54:40 +00:00
< ul class = "nav" >
2014-11-25 00:23:44 +00:00
2013-10-25 15:54:40 +00:00
< 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-25 15:54:40 +00:00
< a href = "Phaser.html" > Phaser< / a >
< / li >
2015-10-15 11:06:38 +00:00
< li class = "class-depth-0" >
< a href = "Phaser.KeyCode.html" > KeyCode< / a >
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-0" >
< a href = "PIXI.html" > PIXI< / a >
< / li >
2013-10-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +00:00
< a href = "Phaser.AnimationParser.html" > AnimationParser< / a >
< / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.ArraySet.html" > ArraySet< / a >
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.ArrayUtils.html" > ArrayUtils< / a >
< / li >
2014-10-09 15:12:53 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.AudioSprite.html" > AudioSprite< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.BitmapData.html" > BitmapData< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.BitmapText.html" > BitmapText< / a >
< / li >
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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +00:00
< a href = "Phaser.Color.html" > Color< / a >
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-2" >
< a href = "Phaser.Component.Angle.html" > Angle< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Animation.html" > Animation< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.AutoCull.html" > AutoCull< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Bounds.html" > Bounds< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.BringToTop.html" > BringToTop< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Core.html" > Core< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Crop.html" > Crop< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Delta.html" > Delta< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Destroy.html" > Destroy< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.FixedToCamera.html" > FixedToCamera< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Health.html" > Health< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.InCamera.html" > InCamera< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.InputEnabled.html" > InputEnabled< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.InWorld.html" > InWorld< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.LifeSpan.html" > LifeSpan< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.LoadTexture.html" > LoadTexture< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Overlap.html" > Overlap< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.PhysicsBody.html" > PhysicsBody< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Reset.html" > Reset< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.ScaleMinMax.html" > ScaleMinMax< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Component.Smoothed.html" > Smoothed< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.Create.html" > Create< / a >
< / li >
< li class = "class-depth-1" >
< a href = "Phaser.Creature.html" > Creature< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Device.html" > Device< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.DeviceButton.html" > DeviceButton< / a >
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.DOM.html" > DOM< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Easing.html" > Easing< / a >
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Back.html" > Back< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Bounce.html" > Bounce< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Circular.html" > Circular< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Cubic.html" > Cubic< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Elastic.html" > Elastic< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Exponential.html" > Exponential< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Linear.html" > Linear< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Quadratic.html" > Quadratic< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Quartic.html" > Quartic< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Quintic.html" > Quintic< / a >
< / li >
< li class = "class-depth-2" >
< a href = "Phaser.Easing.Sinusoidal.html" > Sinusoidal< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-18 03:01:51 +00:00
< a href = "Phaser.Ellipse.html" > Ellipse< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Events.html" > Events< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-28 15:57:09 +00:00
< a href = "Phaser.Filter.html" > Filter< / a >
< / li >
2014-09-09 14:36:56 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.FlexGrid.html" > FlexGrid< / a >
< / li >
< li class = "class-depth-1" >
< a href = "Phaser.FlexLayer.html" > FlexLayer< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +00:00
< a href = "Phaser.Game.html" > Game< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-21 15:37:26 +00:00
< a href = "Phaser.GameObjectCreator.html" > GameObjectCreator< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.GameObjectFactory.html" > GameObjectFactory< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-05 06:29:17 +00:00
< a href = "Phaser.Gamepad.html" > Gamepad< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Graphics.html" > Graphics< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +00:00
< a href = "Phaser.Group.html" > Group< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-02-08 07:24:22 +00:00
< a href = "Phaser.Image.html" > Image< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.ImageCollection.html" > ImageCollection< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +00:00
< a href = "Phaser.Math.html" > Math< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.Matrix.html" > Matrix< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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 >
2014-02-21 15:37:26 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-3" >
2015-08-24 14:43:45 +00:00
< a href = "Phaser.Physics.Arcade.TilemapCollision.html" > TilemapCollision< / a >
2015-03-23 23:46:30 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.Ninja.html" > Ninja< / a >
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.Ninja.AABB.html" > AABB< / 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.Ninja.Body.html" > Body< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.Ninja.Circle.html" > Circle< / 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.Ninja.Tile.html" > Tile< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-2" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.html" > P2< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.Body.html" > Body< / a >
< / 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 >
< / 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 >
< / 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 >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.InversePointProxy.html" > InversePointProxy< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.LockConstraint.html" > LockConstraint< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.Material.html" > Material< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.PointProxy.html" > PointProxy< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.PrismaticConstraint.html" > PrismaticConstraint< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.RevoluteConstraint.html" > RevoluteConstraint< / a >
< / li >
2014-09-09 14:36:56 +00:00
< li class = "class-depth-3" >
< a href = "Phaser.Physics.P2.RotationalSpring.html" > RotationalSpring< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-3" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.Physics.P2.Spring.html" > Spring< / a >
2014-02-21 15:37:26 +00:00
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +00:00
< a href = "Phaser.Pointer.html" > Pointer< / a >
< / li >
2015-10-15 11:06:38 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.PointerMode.html" > PointerMode< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-11-07 06:10:15 +00:00
< a href = "Phaser.Polygon.html" > Polygon< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.QuadTree.html" > QuadTree< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +00:00
< a href = "Phaser.RequestAnimationFrame.html" > RequestAnimationFrame< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.RetroFont.html" > RetroFont< / a >
< / li >
2014-09-09 14:36:56 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.Rope.html" > Rope< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.RoundedRectangle.html" > RoundedRectangle< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2014-03-14 06:36:05 +00:00
< a href = "Phaser.ScaleManager.html" > ScaleManager< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +00:00
< a href = "Phaser.Tween.html" > Tween< / a >
< / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" >
< a href = "Phaser.TweenData.html" > TweenData< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2013-10-25 15:54:40 +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-25 15:54:40 +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-25 15:54:40 +00:00
< a href = "Phaser.Utils.Debug.html" > Debug< / a >
< / li >
2014-04-10 22:13:43 +00:00
< li class = "class-depth-1" >
2015-07-22 14:31:30 +00:00
< a href = "Phaser.Video.html" > Video< / a >
2013-10-25 15:54:40 +00:00
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-1" >
2015-07-22 14:31:30 +00:00
< a href = "Phaser.World.html" > World< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-07-22 14:31:30 +00:00
< a href = "PIXI.AbstractFilter.html" > AbstractFilter< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-07-22 14:31:30 +00:00
< a href = "PIXI.BaseTexture.html" > BaseTexture< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.CanvasBuffer.html" > CanvasBuffer< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.CanvasGraphics.html" > CanvasGraphics< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.CanvasMaskManager.html" > CanvasMaskManager< / a >
< / li >
2015-08-24 14:43:45 +00:00
< li class = "class-depth-1" >
< a href = "PIXI.CanvasPool.html" > CanvasPool< / a >
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-1" >
< a href = "PIXI.CanvasRenderer.html" > CanvasRenderer< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.CanvasTinter.html" > CanvasTinter< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.ComplexPrimitiveShader.html" > ComplexPrimitiveShader< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.DisplayObject.html" > DisplayObject< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.DisplayObjectContainer.html" > DisplayObjectContainer< / a >
< / li >
2016-02-08 17:01:36 +00:00
< li class = "class-depth-1" >
< a href = "PIXI.EarCut.html" > EarCut< / a >
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-1" >
< a href = "PIXI.Event.html" > Event< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.EventTarget.html" > EventTarget< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.FilterTexture.html" > FilterTexture< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.Graphics.html" > Graphics< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.GraphicsData.html" > GraphicsData< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.PIXI.html" > PIXI< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.PixiFastShader.html" > PixiFastShader< / a >
< / li >
< li class = "class-depth-1" >
< a href = "PIXI.PixiShader.html" > PixiShader< / a >
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.PolyK.html" > PolyK< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.PrimitiveShader.html" > PrimitiveShader< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.RenderTexture.html" > RenderTexture< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.Rope.html" > Rope< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.Sprite.html" > Sprite< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.SpriteBatch.html" > SpriteBatch< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.Strip.html" > Strip< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.StripShader.html" > StripShader< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.Texture.html" > Texture< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.TilingSprite.html" > TilingSprite< / a >
2014-11-15 20:01:46 +00:00
< / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.WebGLBlendModeManager.html" > WebGLBlendModeManager< / a >
2014-11-25 00:23:44 +00:00
< / li >
2014-11-15 20:01:46 +00:00
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.WebGLFastSpriteBatch.html" > WebGLFastSpriteBatch< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.WebGLFilterManager.html" > WebGLFilterManager< / a >
2014-11-15 20:01:46 +00:00
< / li >
< li class = "class-depth-1" >
2015-03-23 23:46:30 +00:00
< a href = "PIXI.WebGLRenderer.html" > WebGLRenderer< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< / ul >
< / li >
< li class = "dropdown" >
< a href = "global.html" class = "dropdown-toggle" data-toggle = "dropdown" > Global< b
class="caret">< / b > < / a >
< ul class = "dropdown-menu " >
2016-06-03 17:48:34 +00:00
< li class = "class-depth-0" >
< a href = "global.html#ANGLE_DOWN" > ANGLE_DOWN< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ANGLE_LEFT" > ANGLE_LEFT< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ANGLE_NORTH_EAST" > ANGLE_NORTH_EAST< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ANGLE_NORTH_WEST" > ANGLE_NORTH_WEST< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ANGLE_RIGHT" > ANGLE_RIGHT< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ANGLE_SOUTH_EAST" > ANGLE_SOUTH_EAST< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ANGLE_SOUTH_WEST" > ANGLE_SOUTH_WEST< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ANGLE_UP" > ANGLE_UP< / a >
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#AUTO" > AUTO< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#BITMAPDATA" > BITMAPDATA< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#BITMAPTEXT" > BITMAPTEXT< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
< a href = "global.html#blendModes" > blendModes< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#BUTTON" > BUTTON< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#CANVAS" > CANVAS< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#CANVAS_FILTER" > CANVAS_FILTER< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#CIRCLE" > CIRCLE< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#CREATURE" > CREATURE< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#DOWN" > DOWN< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ELLIPSE" > ELLIPSE< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#EMITTER" > EMITTER< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#GAMES" > GAMES< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#GRAPHICS" > GRAPHICS< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#GROUP" > GROUP< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#HEADLESS" > HEADLESS< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#IMAGE" > IMAGE< / a >
< / li >
2016-06-03 17:48:34 +00:00
< li class = "class-depth-0" >
< a href = "global.html#intersectsRectangle" > intersectsRectangle< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-0" >
< a href = "global.html#LEFT" > LEFT< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#LINE" > LINE< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#MATRIX" > MATRIX< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#NONE" > NONE< / a >
< / li >
2016-02-08 17:01:36 +00:00
< li class = "class-depth-0" >
< a href = "global.html#PENDING_ATLAS" > PENDING_ATLAS< / a >
< / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-0" >
< a href = "global.html#POINT" > POINT< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#POINTER" > POINTER< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#POLYGON" > POLYGON< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#RECTANGLE" > RECTANGLE< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#RENDERTEXTURE" > RENDERTEXTURE< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#RETROFONT" > RETROFONT< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#RIGHT" > RIGHT< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ROPE" > ROPE< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#ROUNDEDRECTANGLE" > ROUNDEDRECTANGLE< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
< a href = "global.html#scaleModes" > scaleModes< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#SPRITE" > SPRITE< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#SPRITEBATCH" > SPRITEBATCH< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#TEXT" > TEXT< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#TILEMAP" > TILEMAP< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#TILEMAPLAYER" > TILEMAPLAYER< / a >
2014-11-15 20:01:46 +00:00
< / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-0" >
2015-07-22 14:31:30 +00:00
< a href = "global.html#TILESPRITE" > TILESPRITE< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#UP" > UP< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#VERSION" > VERSION< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#VIDEO" > VIDEO< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#WEBGL" > WEBGL< / a >
< / li >
< li class = "class-depth-0" >
< a href = "global.html#WEBGL_FILTER" > WEBGL_FILTER< / a >
2014-11-15 20:01:46 +00:00
< / li >
2013-10-25 15:54:40 +00:00
< / ul >
< / li >
2014-11-25 00:23:44 +00:00
2014-11-15 20:01:46 +00:00
< li class = "dropdown" >
2014-11-25 00:23:44 +00:00
< a href = "#" class = "dropdown-toggle" data-toggle = "dropdown" > Core< b class = "caret" > < / b > < / a >
< ul class = "dropdown-menu " >
2014-12-03 10:39:11 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Game.html" > Game< / a > < / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Group.html" > Group< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.World.html" > World< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Loader.html" > Loader< / a > < / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Cache.html" > Cache< / a > < / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Time.html" > Time< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Camera.html" > Camera< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.StateManager.html" > State Manager< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.TweenManager.html" > Tween Manager< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.SoundManager.html" > Sound Manager< / a > < / li >
2015-01-06 06:57:25 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Input.html" > Input Manager< / a > < / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "Phaser.ScaleManager.html" > Scale Manager< / a > < / li >
< / ul >
< / li >
2014-11-15 20:01:46 +00:00
2014-11-25 00:23:44 +00:00
< li class = "dropdown" >
< a href = "#" class = "dropdown-toggle" data-toggle = "dropdown" > Game Objects< b class = "caret" > < / b > < / a >
2014-11-15 20:01:46 +00:00
< ul class = "dropdown-menu " >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "Phaser.GameObjectFactory.html" > Factory (game.add)< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.GameObjectCreator.html" > Creator (game.make)< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Sprite.html" > Sprite< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Image.html" > Image< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Sound.html" > Sound< / a > < / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Video.html" > Video< / a > < / li >
2015-01-06 06:57:25 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Particles.Arcade.Emitter.html" > Particle Emitter< / a > < / li >
2014-12-03 10:39:11 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Particle.html" > Particle< / a > < / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Text.html" > Text< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Tween.html" > Tween< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.BitmapText.html" > BitmapText< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Tilemap.html" > Tilemap< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.BitmapData.html" > BitmapData< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.RetroFont.html" > RetroFont< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Button.html" > Button< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Animation.html" > Animation< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Graphics.html" > Graphics< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.RenderTexture.html" > RenderTexture< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.TileSprite.html" > TileSprite< / a > < / li >
< / ul >
< / li >
< li class = "dropdown" >
< a href = "#" class = "dropdown-toggle" data-toggle = "dropdown" > Geometry< b class = "caret" > < / b > < / a >
< ul class = "dropdown-menu " >
< li class = "class-depth-1" > < a href = "Phaser.Circle.html" > Circle< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Ellipse.html" > Ellipse< / a > < / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Line.html" > Line< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Matrix.html" > Matrix< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Point.html" > Point< / a > < / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Polygon.html" > Polygon< / a > < / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Rectangle.html" > Rectangle< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.RoundedRectangle.html" > Rounded Rectangle< / a > < / li >
2014-11-25 00:23:44 +00:00
< / ul >
< / li >
2014-11-15 20:01:46 +00:00
2014-11-25 00:23:44 +00:00
< li class = "dropdown" >
< a href = "#" class = "dropdown-toggle" data-toggle = "dropdown" > Physics< b class = "caret" > < / b > < / a >
< ul class = "dropdown-menu " >
< li class = "class-depth-1" > < a href = "Phaser.Physics.Arcade.html" > Arcade Physics< / a > < / li >
< li class = "class-depth-2" > < a href = "Phaser.Physics.Arcade.Body.html" > Body< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Physics.P2.html" > P2 Physics< / a > < / li >
< li class = "class-depth-2" > < a href = "Phaser.Physics.P2.Body.html" > Body< / a > < / li >
< li class = "class-depth-2" > < a href = "Phaser.Physics.P2.Spring.html" > Spring< / a > < / li >
< li class = "class-depth-2" > < a href = "Phaser.Physics.P2.CollisionGroup.html" > CollisionGroup< / a > < / li >
< li class = "class-depth-2" > < a href = "Phaser.Physics.P2.ContactMaterial.html" > ContactMaterial< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Physics.Ninja.html" > Ninja Physics< / a > < / li >
< li class = "class-depth-2" > < a href = "Phaser.Physics.Body.html" > Body< / a > < / li >
2014-11-15 20:01:46 +00:00
< / ul >
< / li >
2014-11-25 00:23:44 +00:00
< li class = "dropdown" >
< a href = "#" class = "dropdown-toggle" data-toggle = "dropdown" > Input< b class = "caret" > < / b > < / a >
< ul class = "dropdown-menu " >
< li class = "class-depth-1" > < a href = "Phaser.InputHandler.html" > Input Handler< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Pointer.html" > Pointer< / a > < / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" > < a href = "Phaser.DeviceButton.html" > Device Button< / a > < / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "Phaser.Mouse.html" > Mouse< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Keyboard.html" > Keyboard< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Key.html" > Key< / a > < / li >
< li class = "class-depth-1" > < a href = "Phaser.Gamepad.html" > Gamepad< / a > < / li >
< / ul >
< / li >
< li class = "dropdown" >
< a href = "#" class = "dropdown-toggle" data-toggle = "dropdown" > Community< b class = "caret" > < / b > < / a >
< ul class = "dropdown-menu " >
2015-03-26 02:55:18 +00:00
< li class = "class-depth-1" > < a href = "http://phaser.io" > Phaser Web Site< / a > < / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "https://github.com/photonstorm/phaser" > Phaser Github< / a > < / li >
2015-03-26 02:55:18 +00:00
< li class = "class-depth-1" > < a href = "http://phaser.io/examples" > Phaser Examples< / a > < / li >
2014-11-25 00:23:44 +00:00
< li class = "class-depth-1" > < a href = "https://github.com/photonstorm/phaser-plugins" > Phaser Plugins< / a > < / li >
< li class = "class-depth-1" > < a href = "http://www.html5gamedevs.com/forum/14-phaser/" > Forum< / a > < / li >
< li class = "class-depth-1" > < a href = "http://stackoverflow.com/questions/tagged/phaser-framework" > Stack Overflow< / a > < / li >
2015-07-22 14:31:30 +00:00
< li class = "class-depth-1" > < a href = "http://phaser.io/learn" > Tutorials< / a > < / li >
2016-05-19 11:36:51 +00:00
< li class = "class-depth-1" > < a href = "http://phaser.io/community/newsletter" > Newsletter< / a > < / li >
2015-03-26 02:55:18 +00:00
< li class = "class-depth-1" > < a href = "http://phaser.io/community/twitter" > Twitter< / a > < / li >
2016-05-19 11:36:51 +00:00
< li class = "class-depth-1" > < a href = "http://phaser.io/news/2015/08/phaser-slack-channel" > Slack< / a > < / li >
2015-03-23 23:46:30 +00:00
< li class = "class-depth-1" > < a href = "https://www.codeandweb.com/texturepacker/phaser" > Texture Packer< / a > < / li >
2014-11-25 00:23:44 +00:00
< / ul >
< / li >
2014-11-15 20:01:46 +00:00
< / ul >
< / div >
< / div >
< div class = "row-fluid" >
2013-10-25 15:54:40 +00:00
< div class = "span12" >
< div id = "main" >
2015-03-23 23:46:30 +00:00
< h1 class = "page-title" > Source: src/pixi/primitives/Graphics.js< / h1 >
2013-10-25 15:54:40 +00:00
< section >
< article >
< pre class = "sunlight-highlight-javascript linenums" > /**
2014-11-15 20:01:46 +00:00
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
2013-10-25 15:54:40 +00:00
/**
2014-11-15 20:01:46 +00:00
* The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them.
*
* @class Graphics
* @extends DisplayObjectContainer
* @constructor
*/
PIXI.Graphics = function()
{
2015-03-23 23:46:30 +00:00
PIXI.DisplayObjectContainer.call(this);
2014-11-15 20:01:46 +00:00
this.renderable = true;
2013-10-25 15:54:40 +00:00
2014-11-15 20:01:46 +00:00
/**
* The alpha value used when filling the Graphics object.
*
* @property fillAlpha
* @type Number
*/
this.fillAlpha = 1;
2014-02-18 03:01:51 +00:00
/**
2014-11-15 20:01:46 +00:00
* The width (thickness) of any lines drawn.
*
* @property lineWidth
* @type Number
*/
this.lineWidth = 0;
2014-03-28 01:42:49 +00:00
2014-02-18 03:01:51 +00:00
/**
2014-11-15 20:01:46 +00:00
* The color of any lines drawn.
*
* @property lineColor
* @type String
* @default 0
*/
this.lineColor = 0;
2013-10-25 15:54:40 +00:00
2014-02-18 03:01:51 +00:00
/**
2014-11-15 20:01:46 +00:00
* Graphics data
*
* @property graphicsData
* @type Array
* @private
*/
this.graphicsData = [];
2013-10-25 15:54:40 +00:00
/**
2014-11-15 20:01:46 +00:00
* The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint.
*
* @property tint
* @type Number
* @default 0xFFFFFF
*/
this.tint = 0xFFFFFF;
2013-10-25 15:54:40 +00:00
2014-03-14 06:36:05 +00:00
/**
2014-11-15 20:01:46 +00:00
* The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode.
*
* @property blendMode
* @type Number
* @default PIXI.blendModes.NORMAL;
*/
this.blendMode = PIXI.blendModes.NORMAL;
/**
* Current path
*
* @property currentPath
* @type Object
* @private
*/
this.currentPath = null;
/**
* Array containing some WebGL-related properties used by the WebGL renderer.
*
* @property _webGL
* @type Array
* @private
*/
this._webGL = [];
2014-03-14 06:36:05 +00:00
2014-02-18 03:01:51 +00:00
/**
2014-11-15 20:01:46 +00:00
* Whether this shape is being used as a mask.
*
* @property isMask
* @type Boolean
*/
this.isMask = false;
2014-02-18 03:01:51 +00:00
/**
2014-11-15 20:01:46 +00:00
* The bounds' padding used for bounds calculation.
*
* @property boundsPadding
* @type Number
*/
this.boundsPadding = 0;
2014-02-18 03:01:51 +00:00
2014-11-15 20:01:46 +00:00
this._localBounds = new PIXI.Rectangle(0,0,1,1);
2014-02-18 03:01:51 +00:00
2014-11-15 20:01:46 +00:00
/**
* Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated.
*
* @property dirty
* @type Boolean
* @private
*/
this.dirty = true;
2014-02-18 03:01:51 +00:00
/**
2014-11-15 20:01:46 +00:00
* Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated.
*
* @property webGLDirty
* @type Boolean
* @private
*/
this.webGLDirty = false;
/**
* Used to detect if the cached sprite object needs to be updated.
*
* @property cachedSpriteDirty
* @type Boolean
* @private
*/
this.cachedSpriteDirty = false;
2013-11-28 15:57:09 +00:00
2013-10-25 15:54:40 +00:00
};
2014-11-15 20:01:46 +00:00
// constructor
PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
PIXI.Graphics.prototype.constructor = PIXI.Graphics;
2013-10-25 15:54:40 +00:00
2014-11-15 20:01:46 +00:00
/**
* Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.
*
* @method lineStyle
* @param lineWidth {Number} width of the line to draw, will update the objects stored style
* @param color {Number} color of the line to draw, will update the objects stored style
* @param alpha {Number} alpha of the line to draw, will update the objects stored style
* @return {Graphics}
*/
PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha)
{
this.lineWidth = lineWidth || 0;
this.lineColor = color || 0;
2015-03-26 02:38:46 +00:00
this.lineAlpha = (alpha === undefined) ? 1 : alpha;
2014-11-15 20:01:46 +00:00
2015-03-23 23:46:30 +00:00
if (this.currentPath)
2014-02-18 03:01:51 +00:00
{
2015-03-23 23:46:30 +00:00
if (this.currentPath.shape.points.length)
2014-11-15 20:01:46 +00:00
{
// halfway through a line? start a new one!
2015-03-23 23:46:30 +00:00
this.drawShape(new PIXI.Polygon(this.currentPath.shape.points.slice(-2)));
2014-11-15 20:01:46 +00:00
}
2015-03-26 02:38:46 +00:00
else
{
// otherwise its empty so lets just set the line properties
this.currentPath.lineWidth = this.lineWidth;
this.currentPath.lineColor = this.lineColor;
this.currentPath.lineAlpha = this.lineAlpha;
}
2014-11-15 20:01:46 +00:00
}
2014-02-18 03:01:51 +00:00
2014-11-15 20:01:46 +00:00
return this;
2014-03-28 01:42:49 +00:00
};
2014-02-18 03:01:51 +00:00
/**
2014-11-15 20:01:46 +00:00
* Moves the current drawing position to x, y.
*
* @method moveTo
* @param x {Number} the X coordinate to move to
* @param y {Number} the Y coordinate to move to
* @return {Graphics}
*/
PIXI.Graphics.prototype.moveTo = function(x, y)
{
2015-03-23 23:46:30 +00:00
this.drawShape(new PIXI.Polygon([x, y]));
2014-11-15 20:01:46 +00:00
return this;
};
2014-02-18 03:01:51 +00:00
2014-11-15 20:01:46 +00:00
/**
* Draws a line using the current line style from the current drawing position to (x, y);
* The current drawing position is then set to (x, y).
*
* @method lineTo
* @param x {Number} the X coordinate to draw to
* @param y {Number} the Y coordinate to draw to
* @return {Graphics}
*/
PIXI.Graphics.prototype.lineTo = function(x, y)
{
2015-03-23 23:46:30 +00:00
if (!this.currentPath)
{
this.moveTo(0, 0);
}
2014-11-15 20:01:46 +00:00
this.currentPath.shape.points.push(x, y);
this.dirty = true;
return this;
2014-03-28 01:42:49 +00:00
};
2014-02-18 03:01:51 +00:00
/**
2014-11-15 20:01:46 +00:00
* Calculate the points for a quadratic bezier curve and then draws it.
* Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c
*
* @method quadraticCurveTo
* @param cpX {Number} Control point x
* @param cpY {Number} Control point y
* @param toX {Number} Destination point x
* @param toY {Number} Destination point y
* @return {Graphics}
*/
PIXI.Graphics.prototype.quadraticCurveTo = function(cpX, cpY, toX, toY)
{
2015-03-23 23:46:30 +00:00
if (this.currentPath)
2014-11-15 20:01:46 +00:00
{
2015-03-26 02:38:46 +00:00
if (this.currentPath.shape.points.length === 0)
{
this.currentPath.shape.points = [0, 0];
}
2014-11-15 20:01:46 +00:00
}
else
{
this.moveTo(0,0);
}
2015-03-26 02:38:46 +00:00
var xa,
ya,
n = 20,
points = this.currentPath.shape.points;
2014-11-15 20:01:46 +00:00
2015-03-26 02:38:46 +00:00
if (points.length === 0)
{
this.moveTo(0, 0);
}
2014-02-18 03:01:51 +00:00
2015-03-23 23:46:30 +00:00
var fromX = points[points.length - 2];
var fromY = points[points.length - 1];
2014-11-15 20:01:46 +00:00
var j = 0;
2015-03-26 02:38:46 +00:00
for (var i = 1; i < = n; ++i)
2014-02-18 03:01:51 +00:00
{
2014-11-15 20:01:46 +00:00
j = i / n;
xa = fromX + ( (cpX - fromX) * j );
ya = fromY + ( (cpY - fromY) * j );
points.push( xa + ( ((cpX + ( (toX - cpX) * j )) - xa) * j ),
ya + ( ((cpY + ( (toY - cpY) * j )) - ya) * j ) );
2014-02-18 03:01:51 +00:00
}
2014-11-15 20:01:46 +00:00
this.dirty = true;
return this;
2014-03-28 01:42:49 +00:00
};
2014-02-18 03:01:51 +00:00
2013-10-25 15:54:40 +00:00
/**
2014-11-15 20:01:46 +00:00
* Calculate the points for a bezier curve and then draws it.
*
* @method bezierCurveTo
* @param cpX {Number} Control point x
* @param cpY {Number} Control point y
* @param cpX2 {Number} Second Control point x
* @param cpY2 {Number} Second Control point y
* @param toX {Number} Destination point x
* @param toY {Number} Destination point y
* @return {Graphics}
*/
PIXI.Graphics.prototype.bezierCurveTo = function(cpX, cpY, cpX2, cpY2, toX, toY)
{
2015-03-23 23:46:30 +00:00
if (this.currentPath)
2014-11-15 20:01:46 +00:00
{
2015-03-26 02:38:46 +00:00
if (this.currentPath.shape.points.length === 0)
{
this.currentPath.shape.points = [0, 0];
}
2014-11-15 20:01:46 +00:00
}
else
{
this.moveTo(0,0);
}
2015-03-26 02:38:46 +00:00
var n = 20,
dt,
dt2,
dt3,
t2,
t3,
points = this.currentPath.shape.points;
2014-11-15 20:01:46 +00:00
var fromX = points[points.length-2];
var fromY = points[points.length-1];
var j = 0;
2014-03-14 06:36:05 +00:00
2015-03-26 02:38:46 +00:00
for (var i = 1; i < = n; ++i)
2014-11-15 20:01:46 +00:00
{
j = i / n;
2014-04-29 14:39:02 +00:00
2014-11-15 20:01:46 +00:00
dt = (1 - j);
dt2 = dt * dt;
dt3 = dt2 * dt;
2013-10-25 15:54:40 +00:00
2014-11-15 20:01:46 +00:00
t2 = j * j;
t3 = t2 * j;
points.push( dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX,
dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY);
}
this.dirty = true;
2014-04-29 14:39:02 +00:00
2014-11-15 20:01:46 +00:00
return this;
};
2013-10-25 15:54:40 +00:00
2014-11-15 20:01:46 +00:00
/*
* The arcTo() method creates an arc/curve between two tangents on the canvas.
*
* "borrowed" from https://code.google.com/p/fxcanvas/ - thanks google!
*
* @method arcTo
* @param x1 {Number} The x-coordinate of the beginning of the arc
* @param y1 {Number} The y-coordinate of the beginning of the arc
* @param x2 {Number} The x-coordinate of the end of the arc
* @param y2 {Number} The y-coordinate of the end of the arc
* @param radius {Number} The radius of the arc
* @return {Graphics}
*/
PIXI.Graphics.prototype.arcTo = function(x1, y1, x2, y2, radius)
{
2015-03-23 23:46:30 +00:00
if (this.currentPath)
2013-10-25 15:54:40 +00:00
{
2015-03-23 23:46:30 +00:00
if (this.currentPath.shape.points.length === 0)
2014-03-14 06:36:05 +00:00
{
2014-11-15 20:01:46 +00:00
this.currentPath.shape.points.push(x1, y1);
2014-03-14 06:36:05 +00:00
}
2014-11-15 20:01:46 +00:00
}
else
{
this.moveTo(x1, y1);
}
2015-03-26 02:38:46 +00:00
var points = this.currentPath.shape.points,
fromX = points[points.length-2],
fromY = points[points.length-1],
a1 = fromY - y1,
b1 = fromX - x1,
a2 = y2 - y1,
b2 = x2 - x1,
mm = Math.abs(a1 * b2 - b1 * a2);
2014-11-15 20:01:46 +00:00
if (mm < 1.0e-8 || radius === 0)
{
2015-03-23 23:46:30 +00:00
if (points[points.length-2] !== x1 || points[points.length-1] !== y1)
2014-03-14 06:36:05 +00:00
{
2014-11-15 20:01:46 +00:00
points.push(x1, y1);
2014-03-14 06:36:05 +00:00
}
}
2014-11-15 20:01:46 +00:00
else
{
2015-03-26 02:38:46 +00:00
var dd = a1 * a1 + b1 * b1,
cc = a2 * a2 + b2 * b2,
tt = a1 * a2 + b1 * b2,
k1 = radius * Math.sqrt(dd) / mm,
k2 = radius * Math.sqrt(cc) / mm,
j1 = k1 * tt / dd,
j2 = k2 * tt / cc,
cx = k1 * b2 + k2 * b1,
cy = k1 * a2 + k2 * a1,
px = b1 * (k2 + j1),
py = a1 * (k2 + j1),
qx = b2 * (k1 + j2),
qy = a2 * (k1 + j2),
startAngle = Math.atan2(py - cy, px - cx),
endAngle = Math.atan2(qy - cy, qx - cx);
2014-11-15 20:01:46 +00:00
this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1);
}
this.dirty = true;
2014-03-14 06:36:05 +00:00
2014-11-15 20:01:46 +00:00
return this;
};
2014-03-14 06:36:05 +00:00
2014-11-15 20:01:46 +00:00
/**
* The arc method creates an arc/curve (used to create circles, or parts of circles).
*
* @method arc
* @param cx {Number} The x-coordinate of the center of the circle
* @param cy {Number} The y-coordinate of the center of the circle
* @param radius {Number} The radius of the circle
* @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)
* @param endAngle {Number} The ending angle, in radians
* @param anticlockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.
2016-02-08 17:01:36 +00:00
* @param segments {Number} Optional. The number of segments to use when calculating the arc. The default is 40. If you need more fidelity use a higher number.
2014-11-15 20:01:46 +00:00
* @return {Graphics}
*/
2016-02-08 17:01:36 +00:00
PIXI.Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise, segments)
2014-11-15 20:01:46 +00:00
{
2015-03-26 02:38:46 +00:00
// If we do this we can never draw a full circle
if (startAngle === endAngle)
2014-03-14 06:36:05 +00:00
{
2015-03-26 02:38:46 +00:00
return this;
2014-11-15 20:01:46 +00:00
}
2015-03-26 02:38:46 +00:00
2015-07-22 14:31:30 +00:00
if (anticlockwise === undefined) { anticlockwise = false; }
2016-02-08 17:01:36 +00:00
if (segments === undefined) { segments = 40; }
2014-11-15 20:01:46 +00:00
2015-03-23 23:46:30 +00:00
if (!anticlockwise & & endAngle < = startAngle)
2014-11-15 20:01:46 +00:00
{
endAngle += Math.PI * 2;
}
2015-03-23 23:46:30 +00:00
else if (anticlockwise & & startAngle < = endAngle)
2014-11-15 20:01:46 +00:00
{
startAngle += Math.PI * 2;
}
2015-03-26 02:38:46 +00:00
var sweep = anticlockwise ? (startAngle - endAngle) * -1 : (endAngle - startAngle);
2016-02-08 17:01:36 +00:00
var segs = Math.ceil(Math.abs(sweep) / (Math.PI * 2)) * segments;
2015-03-26 02:38:46 +00:00
// Sweep check - moved here because we don't want to do the moveTo below if the arc fails
if (sweep === 0)
{
return this;
}
var startX = cx + Math.cos(startAngle) * radius;
var startY = cy + Math.sin(startAngle) * radius;
if (anticlockwise & & this.filling)
{
this.moveTo(cx, cy);
}
else
{
this.moveTo(startX, startY);
}
2014-11-15 20:01:46 +00:00
2015-03-26 02:38:46 +00:00
// currentPath will always exist after calling a moveTo
var points = this.currentPath.shape.points;
2014-11-15 20:01:46 +00:00
2015-03-23 23:46:30 +00:00
var theta = sweep / (segs * 2);
var theta2 = theta * 2;
2014-11-15 20:01:46 +00:00
var cTheta = Math.cos(theta);
var sTheta = Math.sin(theta);
var segMinus = segs - 1;
2015-03-23 23:46:30 +00:00
var remainder = (segMinus % 1) / segMinus;
2014-11-15 20:01:46 +00:00
2015-03-23 23:46:30 +00:00
for (var i = 0; i < = segMinus; i++)
2014-11-15 20:01:46 +00:00
{
var real = i + remainder * i;
var angle = ((theta) + startAngle + (theta2 * real));
var c = Math.cos(angle);
var s = -Math.sin(angle);
points.push(( (cTheta * c) + (sTheta * s) ) * radius + cx,
( (cTheta * -s) + (sTheta * c) ) * radius + cy);
}
this.dirty = true;
return this;
};
/**
* Specifies a simple one-color fill that subsequent calls to other Graphics methods
* (such as lineTo() or drawCircle()) use when drawing.
*
* @method beginFill
* @param color {Number} the color of the fill
* @param alpha {Number} the alpha of the fill
* @return {Graphics}
*/
PIXI.Graphics.prototype.beginFill = function(color, alpha)
{
this.filling = true;
this.fillColor = color || 0;
this.fillAlpha = (alpha === undefined) ? 1 : alpha;
2015-03-23 23:46:30 +00:00
if (this.currentPath)
2014-11-15 20:01:46 +00:00
{
2015-03-23 23:46:30 +00:00
if (this.currentPath.shape.points.length < = 2)
2014-03-14 06:36:05 +00:00
{
2014-11-15 20:01:46 +00:00
this.currentPath.fill = this.filling;
this.currentPath.fillColor = this.fillColor;
this.currentPath.fillAlpha = this.fillAlpha;
2014-03-14 06:36:05 +00:00
}
2013-10-25 15:54:40 +00:00
}
2015-03-23 23:46:30 +00:00
2014-11-15 20:01:46 +00:00
return this;
};
2013-10-25 15:54:40 +00:00
2014-11-15 20:01:46 +00:00
/**
* Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.
*
* @method endFill
* @return {Graphics}
*/
PIXI.Graphics.prototype.endFill = function()
{
this.filling = false;
this.fillColor = null;
this.fillAlpha = 1;
return this;
};
2014-02-18 03:01:51 +00:00
2014-11-15 20:01:46 +00:00
/**
* @method drawRect
*
* @param x {Number} The X coord of the top-left of the rectangle
* @param y {Number} The Y coord of the top-left of the rectangle
* @param width {Number} The width of the rectangle
* @param height {Number} The height of the rectangle
* @return {Graphics}
*/
2015-03-23 23:46:30 +00:00
PIXI.Graphics.prototype.drawRect = function(x, y, width, height)
2014-11-15 20:01:46 +00:00
{
2015-03-23 23:46:30 +00:00
this.drawShape(new PIXI.Rectangle(x, y, width, height));
2014-11-15 20:01:46 +00:00
return this;
};
2013-10-25 15:54:40 +00:00
2014-11-15 20:01:46 +00:00
/**
* @method drawRoundedRect
* @param x {Number} The X coord of the top-left of the rectangle
* @param y {Number} The Y coord of the top-left of the rectangle
* @param width {Number} The width of the rectangle
* @param height {Number} The height of the rectangle
2015-07-22 14:31:30 +00:00
* @param radius {Number} Radius of the rectangle corners. In WebGL this must be a value between 0 and 9.
2014-11-15 20:01:46 +00:00
*/
2015-03-23 23:46:30 +00:00
PIXI.Graphics.prototype.drawRoundedRect = function(x, y, width, height, radius)
2014-11-15 20:01:46 +00:00
{
this.drawShape(new PIXI.RoundedRectangle(x, y, width, height, radius));
return this;
};
2014-04-29 14:39:02 +00:00
2015-07-22 14:31:30 +00:00
/**
* Draws a circle.
*
* @method drawCircle
* @param x {Number} The X coordinate of the center of the circle
* @param y {Number} The Y coordinate of the center of the circle
* @param diameter {Number} The diameter of the circle
* @return {Graphics}
*/
2015-03-23 23:46:30 +00:00
PIXI.Graphics.prototype.drawCircle = function(x, y, diameter)
2014-11-15 20:01:46 +00:00
{
2015-03-23 23:46:30 +00:00
this.drawShape(new PIXI.Circle(x, y, diameter));
2014-11-15 20:01:46 +00:00
return this;
2014-03-28 01:42:49 +00:00
};
2013-10-25 15:54:40 +00:00
2014-11-15 20:01:46 +00:00
/**
* Draws an ellipse.
*
* @method drawEllipse
* @param x {Number} The X coordinate of the center of the ellipse
* @param y {Number} The Y coordinate of the center of the ellipse
* @param width {Number} The half width of the ellipse
* @param height {Number} The half height of the ellipse
* @return {Graphics}
*/
PIXI.Graphics.prototype.drawEllipse = function(x, y, width, height)
{
this.drawShape(new PIXI.Ellipse(x, y, width, height));
return this;
};
2013-11-07 06:10:15 +00:00
2014-11-15 20:01:46 +00:00
/**
* Draws a polygon using the given path.
*
* @method drawPolygon
2015-07-22 14:31:30 +00:00
* @param path {Array|Phaser.Polygon} The path data used to construct the polygon. Can either be an array of points or a Phaser.Polygon object.
2014-11-15 20:01:46 +00:00
* @return {Graphics}
*/
PIXI.Graphics.prototype.drawPolygon = function(path)
{
2015-07-22 14:31:30 +00:00
if (path instanceof Phaser.Polygon || path instanceof PIXI.Polygon)
{
path = path.points;
}
2015-03-26 02:38:46 +00:00
// prevents an argument assignment deopt
// see section 3.1: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments
var points = path;
if (!Array.isArray(points))
{
// prevents an argument leak deopt
// see section 3.2: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments
points = new Array(arguments.length);
2015-03-23 23:46:30 +00:00
2015-03-26 02:38:46 +00:00
for (var i = 0; i < points.length; ++i)
{
points[i] = arguments[i];
}
}
this.drawShape(new Phaser.Polygon(points));
2015-03-23 23:46:30 +00:00
2014-11-15 20:01:46 +00:00
return this;
};
2013-11-28 15:57:09 +00:00
2014-11-15 20:01:46 +00:00
/**
* Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.
*
* @method clear
* @return {Graphics}
*/
PIXI.Graphics.prototype.clear = function()
{
this.lineWidth = 0;
this.filling = false;
this.dirty = true;
this.clearDirty = true;
this.graphicsData = [];
return this;
};
2013-11-28 15:57:09 +00:00
2014-11-15 20:01:46 +00:00
/**
* Useful function that returns a texture of the graphics object that can then be used to create sprites
* This can be quite useful if your geometry is complicated and needs to be reused multiple times.
*
* @method generateTexture
2016-02-17 13:27:09 +00:00
* @param [resolution=1] {Number} The resolution of the texture being generated
* @param [scaleMode=0] {Number} Should be one of the PIXI.scaleMode consts
* @param [padding=0] {Number} Add optional extra padding to the generated texture (default 0)
2014-11-15 20:01:46 +00:00
* @return {Texture} a texture of the graphics object
*/
2016-02-17 13:27:09 +00:00
PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode, padding)
2014-11-15 20:01:46 +00:00
{
2016-02-17 13:27:09 +00:00
if (resolution === undefined) { resolution = 1; }
if (scaleMode === undefined) { scaleMode = PIXI.scaleModes.DEFAULT; }
if (padding === undefined) { padding = 0; }
2014-11-15 20:01:46 +00:00
var bounds = this.getBounds();
2016-02-17 13:27:09 +00:00
bounds.width += padding;
bounds.height += padding;
2014-11-15 20:01:46 +00:00
var canvasBuffer = new PIXI.CanvasBuffer(bounds.width * resolution, bounds.height * resolution);
var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas, scaleMode);
2016-02-17 13:27:09 +00:00
2014-11-15 20:01:46 +00:00
texture.baseTexture.resolution = resolution;
2014-03-28 01:42:49 +00:00
2014-11-15 20:01:46 +00:00
canvasBuffer.context.scale(resolution, resolution);
2015-08-24 14:43:45 +00:00
canvasBuffer.context.translate(-bounds.x, -bounds.y);
2015-10-15 11:06:38 +00:00
// Call here
2014-11-15 20:01:46 +00:00
PIXI.CanvasGraphics.renderGraphics(this, canvasBuffer.context);
return texture;
2014-03-28 01:42:49 +00:00
};
2013-11-07 06:10:15 +00:00
2014-11-15 20:01:46 +00:00
/**
* Renders the object using the WebGL renderer
2014-05-20 09:12:48 +00:00
*
2014-11-15 20:01:46 +00:00
* @method _renderWebGL
* @param renderSession {RenderSession}
* @private
2014-05-20 09:12:48 +00:00
*/
2014-11-15 20:01:46 +00:00
PIXI.Graphics.prototype._renderWebGL = function(renderSession)
{
// if the sprite is not visible or the alpha is 0 then no need to render this element
2015-03-23 23:46:30 +00:00
if (this.visible === false || this.alpha === 0 || this.isMask === true) return;
2014-05-20 09:12:48 +00:00
2015-03-23 23:46:30 +00:00
if (this._cacheAsBitmap)
2014-05-20 09:12:48 +00:00
{
2015-03-23 23:46:30 +00:00
if (this.dirty || this.cachedSpriteDirty)
2014-05-20 09:12:48 +00:00
{
2014-11-15 20:01:46 +00:00
this._generateCachedSprite();
// we will also need to update the texture on the gpu too!
this.updateCachedSpriteTexture();
this.cachedSpriteDirty = false;
this.dirty = false;
2014-05-20 09:12:48 +00:00
}
2014-11-15 20:01:46 +00:00
this._cachedSprite.worldAlpha = this.worldAlpha;
2015-03-23 23:46:30 +00:00
2014-11-15 20:01:46 +00:00
PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession);
return;
2014-05-20 09:12:48 +00:00
}
else
{
2014-11-15 20:01:46 +00:00
renderSession.spriteBatch.stop();
renderSession.blendModeManager.setBlendMode(this.blendMode);
2015-03-23 23:46:30 +00:00
if (this._mask) renderSession.maskManager.pushMask(this._mask, renderSession);
if (this._filters) renderSession.filterManager.pushFilter(this._filterBlock);
2014-11-15 20:01:46 +00:00
// check blend mode
2015-03-23 23:46:30 +00:00
if (this.blendMode !== renderSession.spriteBatch.currentBlendMode)
2014-11-15 20:01:46 +00:00
{
renderSession.spriteBatch.currentBlendMode = this.blendMode;
var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode];
renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]);
}
// check if the webgl graphic needs to be updated
2015-03-23 23:46:30 +00:00
if (this.webGLDirty)
2014-11-15 20:01:46 +00:00
{
this.dirty = true;
this.webGLDirty = false;
}
PIXI.WebGLGraphics.renderGraphics(this, renderSession);
// only render if it has children!
2015-03-23 23:46:30 +00:00
if (this.children.length)
2014-11-15 20:01:46 +00:00
{
renderSession.spriteBatch.start();
2015-03-23 23:46:30 +00:00
// simple render children!
for (var i = 0; i < this.children.length; i++)
2014-11-15 20:01:46 +00:00
{
this.children[i]._renderWebGL(renderSession);
}
renderSession.spriteBatch.stop();
}
2015-03-23 23:46:30 +00:00
if (this._filters) renderSession.filterManager.popFilter();
if (this._mask) renderSession.maskManager.popMask(this.mask, renderSession);
2014-11-15 20:01:46 +00:00
renderSession.drawCount++;
2014-05-20 09:12:48 +00:00
2014-11-15 20:01:46 +00:00
renderSession.spriteBatch.start();
}
2014-05-20 09:12:48 +00:00
};
2014-11-15 20:01:46 +00:00
/**
* Renders the object using the Canvas renderer
2014-05-20 09:12:48 +00:00
*
2014-11-15 20:01:46 +00:00
* @method _renderCanvas
* @param renderSession {RenderSession}
* @private
2014-05-20 09:12:48 +00:00
*/
2014-11-15 20:01:46 +00:00
PIXI.Graphics.prototype._renderCanvas = function(renderSession)
{
2015-07-22 14:31:30 +00:00
// if the sprite is not visible or the alpha is 0 then no need to render this element
if (this.visible === false || this.alpha === 0 || this.isMask === true) return;
2015-03-26 02:38:46 +00:00
// if the tint has changed, set the graphics object to dirty.
if (this._prevTint !== this.tint) {
this.dirty = true;
this._prevTint = this.tint;
}
2015-03-23 23:46:30 +00:00
if (this._cacheAsBitmap)
2014-11-15 20:01:46 +00:00
{
2015-03-23 23:46:30 +00:00
if (this.dirty || this.cachedSpriteDirty)
2014-11-15 20:01:46 +00:00
{
this._generateCachedSprite();
// we will also need to update the texture
this.updateCachedSpriteTexture();
2014-05-20 09:12:48 +00:00
2014-11-15 20:01:46 +00:00
this.cachedSpriteDirty = false;
this.dirty = false;
}
2014-05-20 09:12:48 +00:00
2014-11-15 20:01:46 +00:00
this._cachedSprite.alpha = this.alpha;
2015-10-15 11:06:38 +00:00
2014-11-15 20:01:46 +00:00
PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, renderSession);
2014-05-20 09:12:48 +00:00
2014-11-15 20:01:46 +00:00
return;
}
else
2014-05-20 09:12:48 +00:00
{
2014-11-15 20:01:46 +00:00
var context = renderSession.context;
var transform = this.worldTransform;
2015-03-23 23:46:30 +00:00
if (this.blendMode !== renderSession.currentBlendMode)
2014-05-20 09:12:48 +00:00
{
2014-11-15 20:01:46 +00:00
renderSession.currentBlendMode = this.blendMode;
context.globalCompositeOperation = PIXI.blendModesCanvas[renderSession.currentBlendMode];
2014-05-20 09:12:48 +00:00
}
2014-11-15 20:01:46 +00:00
2015-03-23 23:46:30 +00:00
if (this._mask)
2014-05-20 09:12:48 +00:00
{
2014-11-15 20:01:46 +00:00
renderSession.maskManager.pushMask(this._mask, renderSession);
}
var resolution = renderSession.resolution;
2016-04-22 14:15:28 +00:00
var tx = (transform.tx * renderSession.resolution) + renderSession.shakeX;
var ty = (transform.ty * renderSession.resolution) + renderSession.shakeY;
2015-03-23 23:46:30 +00:00
2014-11-15 20:01:46 +00:00
context.setTransform(transform.a * resolution,
transform.b * resolution,
transform.c * resolution,
transform.d * resolution,
2016-04-22 14:15:28 +00:00
tx,
ty);
2014-11-15 20:01:46 +00:00
PIXI.CanvasGraphics.renderGraphics(this, context);
// simple render children!
2015-03-23 23:46:30 +00:00
for (var i = 0; i < this.children.length; i++)
2014-11-15 20:01:46 +00:00
{
this.children[i]._renderCanvas(renderSession);
}
2015-03-23 23:46:30 +00:00
if (this._mask)
2014-11-15 20:01:46 +00:00
{
renderSession.maskManager.popMask(renderSession);
2014-05-20 09:12:48 +00:00
}
}
2014-11-15 20:01:46 +00:00
};
/**
* Retrieves the bounds of the graphic shape as a rectangle object
*
* @method getBounds
* @return {Rectangle} the rectangular bounding area
*/
2015-03-23 23:46:30 +00:00
PIXI.Graphics.prototype.getBounds = function(matrix)
2014-11-15 20:01:46 +00:00
{
2015-08-24 14:43:45 +00:00
if (!this._currentBounds)
2015-03-26 02:38:46 +00:00
{
2015-08-24 14:43:45 +00:00
// Return an empty object if the item is a mask!
2015-03-26 02:38:46 +00:00
if (!this.renderable)
{
return PIXI.EmptyRectangle;
}
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
if (this.dirty)
{
this.updateLocalBounds();
this.webGLDirty = true;
this.cachedSpriteDirty = true;
this.dirty = false;
}
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
var bounds = this._localBounds;
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
var w0 = bounds.x;
var w1 = bounds.width + bounds.x;
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
var h0 = bounds.y;
var h1 = bounds.height + bounds.y;
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
var worldTransform = matrix || this.worldTransform;
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
var a = worldTransform.a;
var b = worldTransform.b;
var c = worldTransform.c;
var d = worldTransform.d;
var tx = worldTransform.tx;
var ty = worldTransform.ty;
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
var x1 = a * w1 + c * h1 + tx;
var y1 = d * h1 + b * w1 + ty;
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
var x2 = a * w0 + c * h1 + tx;
var y2 = d * h1 + b * w0 + ty;
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
var x3 = a * w0 + c * h0 + tx;
var y3 = d * h0 + b * w0 + ty;
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
var x4 = a * w1 + c * h0 + tx;
var y4 = d * h0 + b * w1 + ty;
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
var maxX = x1;
var maxY = y1;
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
var minX = x1;
var minY = y1;
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
minX = x2 < minX ? x2 : minX;
minX = x3 < minX ? x3 : minX;
minX = x4 < minX ? x4 : minX;
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
minY = y2 < minY ? y2 : minY;
minY = y3 < minY ? y3 : minY;
minY = y4 < minY ? y4 : minY;
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
maxX = x2 > maxX ? x2 : maxX;
maxX = x3 > maxX ? x3 : maxX;
maxX = x4 > maxX ? x4 : maxX;
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
maxY = y2 > maxY ? y2 : maxY;
maxY = y3 > maxY ? y3 : maxY;
maxY = y4 > maxY ? y4 : maxY;
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
this._bounds.x = minX;
this._bounds.width = maxX - minX;
2014-11-15 20:01:46 +00:00
2015-08-24 14:43:45 +00:00
this._bounds.y = minY;
this._bounds.height = maxY - minY;
2014-11-15 20:01:46 +00:00
2015-03-26 02:38:46 +00:00
this._currentBounds = this._bounds;
}
return this._currentBounds;
2015-08-24 14:43:45 +00:00
2015-03-26 02:38:46 +00:00
};
/**
* Tests if a point is inside this graphics object
*
* @param point {Point} the point to test
* @return {boolean} the result of the test
*/
PIXI.Graphics.prototype.containsPoint = function( point )
{
this.worldTransform.applyInverse(point, tempPoint);
var graphicsData = this.graphicsData;
for (var i = 0; i < graphicsData.length; i++)
{
var data = graphicsData[i];
if (!data.fill)
{
continue;
}
// only deal with fills..
if (data.shape)
{
2015-08-24 14:43:45 +00:00
if (data.shape.contains(tempPoint.x, tempPoint.y))
2015-03-26 02:38:46 +00:00
{
return true;
}
}
}
return false;
2015-08-24 14:43:45 +00:00
2014-11-15 20:01:46 +00:00
};
/**
* Update the bounds of the object
*
* @method updateLocalBounds
*/
PIXI.Graphics.prototype.updateLocalBounds = function()
{
var minX = Infinity;
var maxX = -Infinity;
var minY = Infinity;
var maxY = -Infinity;
2015-03-23 23:46:30 +00:00
if (this.graphicsData.length)
2014-11-15 20:01:46 +00:00
{
var shape, points, x, y, w, h;
2015-03-23 23:46:30 +00:00
for (var i = 0; i < this.graphicsData.length; i++)
{
2014-11-15 20:01:46 +00:00
var data = this.graphicsData[i];
var type = data.type;
var lineWidth = data.lineWidth;
shape = data.shape;
2015-03-23 23:46:30 +00:00
if (type === PIXI.Graphics.RECT || type === PIXI.Graphics.RREC)
2014-05-20 09:12:48 +00:00
{
2015-03-23 23:46:30 +00:00
x = shape.x - lineWidth / 2;
y = shape.y - lineWidth / 2;
2014-11-15 20:01:46 +00:00
w = shape.width + lineWidth;
h = shape.height + lineWidth;
2014-05-20 09:12:48 +00:00
2014-11-15 20:01:46 +00:00
minX = x < minX ? x : minX;
maxX = x + w > maxX ? x + w : maxX;
minY = y < minY ? y : minY;
maxY = y + h > maxY ? y + h : maxY;
2014-05-20 09:12:48 +00:00
}
2015-03-23 23:46:30 +00:00
else if (type === PIXI.Graphics.CIRC)
2014-11-15 20:01:46 +00:00
{
x = shape.x;
y = shape.y;
2015-03-23 23:46:30 +00:00
w = shape.radius + lineWidth / 2;
h = shape.radius + lineWidth / 2;
2014-11-15 20:01:46 +00:00
minX = x - w < minX ? x - w : minX;
maxX = x + w > maxX ? x + w : maxX;
minY = y - h < minY ? y - h : minY;
maxY = y + h > maxY ? y + h : maxY;
}
2015-03-23 23:46:30 +00:00
else if (type === PIXI.Graphics.ELIP)
2014-05-20 09:12:48 +00:00
{
2014-11-15 20:01:46 +00:00
x = shape.x;
y = shape.y;
2015-03-23 23:46:30 +00:00
w = shape.width + lineWidth / 2;
h = shape.height + lineWidth / 2;
2014-11-15 20:01:46 +00:00
minX = x - w < minX ? x - w : minX;
maxX = x + w > maxX ? x + w : maxX;
2014-05-20 09:12:48 +00:00
2014-11-15 20:01:46 +00:00
minY = y - h < minY ? y - h : minY;
maxY = y + h > maxY ? y + h : maxY;
}
else
{
2015-03-23 23:46:30 +00:00
// POLY - assumes points are sequential, not Point objects
2014-11-15 20:01:46 +00:00
points = shape.points;
2015-03-23 23:46:30 +00:00
for (var j = 0; j < points.length; j++)
{
if (points[j] instanceof Phaser.Point)
{
x = points[j].x;
y = points[j].y;
}
else
{
x = points[j];
y = points[j + 1];
if (j < points.length - 1)
{
j++;
}
}
minX = x - lineWidth < minX ? x - lineWidth : minX;
maxX = x + lineWidth > maxX ? x + lineWidth : maxX;
minY = y - lineWidth < minY ? y - lineWidth : minY;
maxY = y + lineWidth > maxY ? y + lineWidth : maxY;
2014-05-20 09:12:48 +00:00
}
}
}
}
2014-11-15 20:01:46 +00:00
else
{
minX = 0;
maxX = 0;
minY = 0;
maxY = 0;
}
var padding = this.boundsPadding;
this._localBounds.x = minX - padding;
this._localBounds.width = (maxX - minX) + padding * 2;
this._localBounds.y = minY - padding;
this._localBounds.height = (maxY - minY) + padding * 2;
2014-05-20 09:12:48 +00:00
};
2014-02-08 07:24:22 +00:00
/**
2014-11-15 20:01:46 +00:00
* Generates the cached sprite when the sprite has cacheAsBitmap = true
*
* @method _generateCachedSprite
* @private
*/
PIXI.Graphics.prototype._generateCachedSprite = function()
{
var bounds = this.getLocalBounds();
2015-03-23 23:46:30 +00:00
if (!this._cachedSprite)
2014-11-15 20:01:46 +00:00
{
var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height);
var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas);
this._cachedSprite = new PIXI.Sprite(texture);
this._cachedSprite.buffer = canvasBuffer;
2014-02-18 03:01:51 +00:00
2014-11-15 20:01:46 +00:00
this._cachedSprite.worldTransform = this.worldTransform;
}
else
{
this._cachedSprite.buffer.resize(bounds.width, bounds.height);
2014-02-18 03:01:51 +00:00
}
2014-11-15 20:01:46 +00:00
// leverage the anchor to account for the offset of the element
2015-03-23 23:46:30 +00:00
this._cachedSprite.anchor.x = -(bounds.x / bounds.width);
this._cachedSprite.anchor.y = -(bounds.y / bounds.height);
2014-02-18 03:01:51 +00:00
2015-03-23 23:46:30 +00:00
// this._cachedSprite.buffer.context.save();
this._cachedSprite.buffer.context.translate(-bounds.x, -bounds.y);
2014-11-15 20:01:46 +00:00
// make sure we set the alpha of the graphics to 1 for the render..
this.worldAlpha = 1;
2014-03-28 01:42:49 +00:00
2014-11-15 20:01:46 +00:00
// now render the graphic..
PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context);
this._cachedSprite.alpha = this.alpha;
};
2014-02-18 03:01:51 +00:00
2014-11-15 20:01:46 +00:00
/**
* Updates texture size based on canvas size
*
* @method updateCachedSpriteTexture
* @private
*/
PIXI.Graphics.prototype.updateCachedSpriteTexture = function()
{
var cachedSprite = this._cachedSprite;
var texture = cachedSprite.texture;
var canvas = cachedSprite.buffer.canvas;
texture.baseTexture.width = canvas.width;
texture.baseTexture.height = canvas.height;
texture.crop.width = texture.frame.width = canvas.width;
texture.crop.height = texture.frame.height = canvas.height;
cachedSprite._width = canvas.width;
cachedSprite._height = canvas.height;
// update the dirty base textures
texture.baseTexture.dirty();
};
2014-02-18 03:01:51 +00:00
2014-11-15 20:01:46 +00:00
/**
* Destroys a previous cached sprite.
*
* @method destroyCachedSprite
*/
PIXI.Graphics.prototype.destroyCachedSprite = function()
{
this._cachedSprite.texture.destroy(true);
this._cachedSprite = null;
};
2014-02-18 03:01:51 +00:00
2014-11-15 20:01:46 +00:00
/**
* Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.
*
* @method drawShape
* @param {Circle|Rectangle|Ellipse|Line|Polygon} shape The Shape object to draw.
* @return {GraphicsData} The generated GraphicsData object.
*/
PIXI.Graphics.prototype.drawShape = function(shape)
{
2015-03-23 23:46:30 +00:00
if (this.currentPath)
2014-11-15 20:01:46 +00:00
{
// check current path!
2015-03-23 23:46:30 +00:00
if (this.currentPath.shape.points.length < = 2)
{
this.graphicsData.pop();
}
2014-11-15 20:01:46 +00:00
}
2014-02-18 03:01:51 +00:00
2014-11-15 20:01:46 +00:00
this.currentPath = null;
2015-03-23 23:46:30 +00:00
// Handle mixed-type polygons
2015-07-22 14:31:30 +00:00
if (shape instanceof Phaser.Polygon)
2015-03-23 23:46:30 +00:00
{
2015-07-22 14:31:30 +00:00
shape = shape.clone();
2015-03-23 23:46:30 +00:00
shape.flatten();
}
2014-11-15 20:01:46 +00:00
var data = new PIXI.GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, shape);
this.graphicsData.push(data);
2015-03-23 23:46:30 +00:00
if (data.type === PIXI.Graphics.POLY)
2014-11-15 20:01:46 +00:00
{
data.shape.closed = this.filling;
this.currentPath = data;
2014-02-18 03:01:51 +00:00
}
2014-11-15 20:01:46 +00:00
this.dirty = true;
2014-04-29 14:39:02 +00:00
2014-11-15 20:01:46 +00:00
return data;
};
2014-04-29 14:39:02 +00:00
2015-03-23 23:46:30 +00:00
/**
* When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.
* This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory.
* It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas.
* This is not recommended if you are constantly redrawing the graphics element.
*
* @property cacheAsBitmap
* @type Boolean
* @default false
* @private
*/
Object.defineProperty(PIXI.Graphics.prototype, "cacheAsBitmap", {
get: function() {
return this._cacheAsBitmap;
},
set: function(value) {
this._cacheAsBitmap = value;
if (this._cacheAsBitmap)
{
this._generateCachedSprite();
}
else
{
this.destroyCachedSprite();
}
2016-02-08 17:01:36 +00:00
this.dirty = true;
this.webGLDirty = true;
2015-03-23 23:46:30 +00:00
}
});
2013-10-25 15:54:40 +00:00
< / pre >
< / article >
< / section >
< / div >
< div class = "clearfix" > < / div >
< footer >
< span class = "copyright" >
2016-04-22 14:15:28 +00:00
Phaser Copyright © 2012-2016 Photon Storm Ltd.
2013-10-25 15:54:40 +00:00
< / span >
< br / >
< span class = "jsdoc-message" >
2015-08-24 14:43:45 +00:00
Documentation generated by < a href = "https://github.com/jsdoc3/jsdoc" > JSDoc 3.3.2< / a >
2016-06-03 17:48:34 +00:00
on Fri Jun 03 2016 18:46:47 GMT+0100 (GMT Daylight Time) using the < a href = "https://github.com/terryweiss/docstrap" > DocStrap template< / a > .
2013-10-25 15:54:40 +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-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 >