Commit graph

3300 commits

Author SHA1 Message Date
Richard Davey
b405570833 Docs fix #2624 2016-07-17 11:26:09 +01:00
Richard Davey
6f9bcae23e Docs fixes #2629 2016-07-17 11:23:41 +01:00
Richard Davey
0765e9eaa6 Merge pull request #2634 from greeny/hotfix-bitmapdata-fluent
BitmapData.js: fixed fluent interface
2016-07-17 11:20:40 +01:00
Richard Davey
776c148a93 Fixed jshint errors. 2016-07-16 08:04:56 +01:00
Tomáš Blatný
2b90f2cb3b BitmapData.js: fixed fluent interface 2016-07-15 20:16:35 +02:00
Richard Davey
a01f59d82d Added Path Manager Plugin. 2016-07-13 03:08:03 +01:00
Richard Davey
4548d70369 Experimenting with new MainLoop + position interpolation. (reverted from commit e49d45e278) 2016-07-13 02:44:35 +01:00
Richard Davey
e49d45e278 Experimenting with new MainLoop + position interpolation. 2016-07-12 03:05:29 +01:00
Richard Davey
265501b4af The src/system folder has been removed and all files relocated to the src/utils folder. This doesn't change anything from an API point of view, but did change the grunt build scripts slightly. 2016-07-11 22:38:09 +01:00
photonstorm
9b4bb1bdd8 Group.getRandomExists will return a random child from the Group that has exists set to true.
Group.getAll will return all children in the Group, or a section of the Group, with the optional ability to test if the child has a property matching the given value or not.

Group.iterate has a new `returnType`: `RETURN_ALL`. This allows you to return all children that pass the iteration test in an array.
2016-07-11 17:05:42 +01:00
photonstorm
1467eb48cf A Group with inputEnableChildren set would re-start the Input Handler on a Sprite, even if that handler had been disabled previously. 2016-07-11 14:17:51 +01:00
photonstorm
94498fcd32 The InputHandler.flagged property has been removed. It was never used internally, or exposed via the API, so was just overhead. 2016-07-11 14:17:41 +01:00
photonstorm
9aef9b741c Preparing for 2.6.2 dev. 2016-07-11 10:30:09 +01:00
photonstorm
ac2516f5aa 2.6.1 Release. 2016-07-11 10:07:56 +01:00
Richard Davey
cfb2b813ef Fixed Uncaught TypeError: Cannot set property 'x' of undefined in Body.js (thanks @ErwanErwan #2607) 2016-07-08 18:54:00 +01:00
photonstorm
aaa9f0d61a Preparing for 2.6.1 dev. 2016-07-08 16:18:59 +01:00
photonstorm
fced3f86ec Phaser 2.6.0 Release. 2016-07-08 15:46:26 +01:00
photonstorm
8a8fa0297d Preparing for release. 2016-07-08 14:26:31 +01:00
photonstorm
61ce14f332 P2.World.clear will now clear out the World.walls property, resetting all of the wall bounds to null. This allows the walls to be re-created accurately when the P2 World is reset, which happens on a State change or restart (thanks @ewpolly1 @codermua #2574) 2016-07-08 13:02:58 +01:00
photonstorm
521a6c9dbb Sound.stop will check to see if gainNode exists before trying to disconnect from it. 2016-07-08 12:27:12 +01:00
photonstorm
c34c7bae4e Docs updates. 2016-07-08 12:04:28 +01:00
photonstorm
dfd9203e0a onWorldBounds now sends the bounds it collided with. 2016-07-08 11:28:45 +01:00
photonstorm
ee202667ed Huge docs update for all of the Game Object events. 2016-07-08 11:28:30 +01:00
Richard Davey
0014201917 Groups now have the following properties, which are getters and setters: centerX, centerY, left, right, top and bottom. These calculate the bounds of the Group, based on all visible children, and then allow you to apply positioning based on that. This means you can, for example, now get the horizontal center of a Group by called Group.centerX. These properties are also setters, so you can position the Groups, and it will take scale and rotation into consideration.
Groups have a new method `alignIn`. It allows you to align the Group within another Game Object, or a Rectangle. You can specify one of 9 positions which are the new position constants such as: `Phaser.TOP_LEFT` or `Phaser.CENTER` (see docs for the complete list). The Groups are positioned based on their child bounds, which takes rotation and scaling into consideration. You can easily place Groups into the corners of the screen, or game world, or align them within other Sprites, using this method.

Groups have a new method `alignTo`. It allows you to align a Group to the side of another Game Object, or a Rectangle. You can specify one of 11 positions which are the new position constants such as: `Phaser.TOP_LEFT` or `Phaser.LEFT_BOTTOM` (see docs for the complete list). The Groups are positioned based on their child bounds, which takes rotation and scaling into consideration. You can easily align Groups next to other Sprites using this method.
2016-07-08 01:33:42 +01:00
Richard Davey
410237881e PIXI.DisplayObjectContainer calls updateTransform at the start of getBounds to help avoid the bounds being out of date. 2016-07-08 01:06:25 +01:00
Richard Davey
c0ba439e82 ArcadePhysics.Body.onCollide is a new Signal that is dispatched whenever the Body collides with another Body. Due to the potentially high volume of signals this could create it is disabled by default. To use this feature set this property to a Phaser.Signal: sprite.body.onCollide = new Phaser.Signal() and it will be called when a collision happens, passing two arguments: the sprites which collided.
ArcadePhysics.Body.onOverlap is a new Signal that is dispatched whenever the Body overlaps with another Body. Due to the potentially high volume of signals this could create it is disabled by default. To use this feature set this property to a Phaser.Signal: `sprite.body.onOverlap = new Phaser.Signal()` and it will be called when an overlap happens, passing two arguments: the sprites which collided.
2016-07-07 23:16:18 +01:00
Richard Davey
6ba3c9401f ArcadePhysics.Body.setCircle is a new method that allows you to define an Arcade Physics Body as being a circle instead of a rectangle. You can control the radius of the body and the offset from the parent sprite.
ArcadePhysics.World.separateCircle is a new method that handles all circular body collisions internally within Arcade Physics (thanks @VitaZheltyakov)

All of the Arcade Physics internal methods, such as `collideGroupVsSelf`, `collideSpriteVsSprite` and so on, have been updated to work with circular body shapes (thanks @VitaZheltyakov)

ArcadePhysics.Body.onWorldBounds is a new Signal that is dispatched whenever the Body collides with the world bounds, something that was previously difficult to detect. Due to the potentially high volume of signals this could create it is disabled by default. To use this feature set this property to a Phaser.Signal: `sprite.body.onWorldBounds = new Phaser.Signal()` and it will be called when a collision happens, passing one argument: the sprite on which it occurred.
2016-07-07 21:58:39 +01:00
photonstorm
261155a683 Merged the arcade-circles branch back into 2.6 and tidied up lots of the source code. Needs checking as not working properly with rect vs. circle, but fine with circle vs. circle. 2016-07-07 16:45:10 +01:00
Richard Davey
97bba5f3c7 toABGR updated. 2016-07-06 22:40:05 +01:00
Richard Davey
d93019e86b Moved to 2.6.0 2016-07-06 22:40:00 +01:00
Richard Davey
63158a1dbf Argument swapped for destroyBaseTexture. 2016-07-06 22:31:26 +01:00
Richard Davey
c4d7870a31 * PIXI.Texture.fromImage, PIXI.BaseTexture.fromImage and PIXI.Sprite.fromImage have all been removed. They should never have actually been used, as they bypass the Phaser Loader, and don't factor in CORs or any other advanced loader settings.
* The PIXI.BaseTexture.imageUrl property has been removed, as it was never actually populated.
* The PIXI.BaseTexture._UID property has been removed, as it was never actually used internally.
* All references to PIXI.BaseTextureCache have been removed (primarily from BaseTexture.destroy and Texture.destroy), as the BaseTextureCache was never used internally by Phaser, or by our custom version of Pixi.
* PIXI.TextureCache has been removed. It was only ever used by the __default and __missing images that Phaser generates on start-up. It wasn't used internally by Phaser anywhere else, and the only references Pixi has to it have all been removed. If you need it in your own game, please refactor it to avoid it, or re-create the object on the PIXI global object.
* Canvases created by `BaseTexture.fromCanvas` no longer have the `_pixiId` property attached to them, as this was never used internally by Phaser or Pixi.
* PIXI.BaseTexture.updateSourceImage is now deprecated. Please use `Sprite.loadTexture` instead.
* The property PIXI.BaseTextureCacheIdGenerator has been removed, as it is no longer used internally by Phaser or Pixi.
* PIXI.Texture.addTextureToCache has been removed. The PIXI Texture Cache was never actually used by Phaser, and was leading to complications internally.
* PIXI.Texture.removeTextureFromCache has been removed. The PIXI Texture Cache was never actually used by Phaser, and was leading to complications internally.
* PIXI.Texture.fromFrame and PIXI.Sprite.fromFrame have been removed. They relied on the PIXI Texture Cache, which was never actually used by Phaser, and was never used internally by Pixi either.
* The property PIXI.TextureCacheIdGenerator has been removed, as it was not used internally.
* The property PIXI.FrameCache has been removed, as it was not used internally.
2016-07-06 21:47:27 +01:00
Richard Davey
440e2afe7c * PIXI.CanvasPool no longer _just_ checks for null parent comparisons. It will check for all falsey parents, helping free-up canvases when the parent objects have been removed elsewhere.
* PIXI.CanvasPool.remove and `removeByCanvas` both now set the removed canvas width and height to 1.
2016-07-06 21:47:05 +01:00
Richard Davey
886c641ddc * The default image texture, for when none is supplied, is now available under Phaser.Cache.DEFAULT.
* The missing image texture, for when an image has failed to load, is now available under `Phaser.Cache.MISSING`.
* Phaser.Cache.addImage will now check the key given, and if `__default` or `__missing` it will update the new consts `Phaser.Cache.DEFAULT` and `Phaser.Cache.MISSING` accordingly, allowing you to replace the default or missing image textures used by Phaser.
* Phaser.Cache.getPixiTexture has now been removed, as the Pixi Cache isn't used internally anywhere any longer.
* Phaser.Cache.getPixiBaseTexture has now been removed, as the Pixi Cache isn't used internally anywhere any longer.
2016-07-06 21:46:40 +01:00
Richard Davey
8a3c71f050 CanvasPool parent checks are now falsey, not just !== null. 2016-07-06 20:59:42 +01:00
Richard Davey
33150018ad Text.fontPropertiesCanvas no longer uses a CanvasPool entry. 2016-07-06 20:59:28 +01:00
Richard Davey
3642ff0489 Phaser.Color.toABGR converts RGBA components to a 32 bit integer in AABBGGRR format. 2016-07-04 18:50:42 +01:00
photonstorm
e08e0861d0 Phaser.ArrayUtils.rotate is now deprecated. Please use Phaser.ArrayUtils.rotateLeft instead. 2016-07-04 13:09:36 +01:00
photonstorm
0036bf747f BitmapData has a new, optional, fifth argument: skipPool. By default BitmapData objects will ask for the first free canvas found in the CanvasPool, but this behavior can now be customized on a per object basis. 2016-07-04 12:57:08 +01:00
photonstorm
cb0861d881 The canvas created by Phaser.Debug for use when displaying debug data is no longer stored in the CanvasPool, and is instead a stand-alone canvas, free from ever being re-used by another game object. 2016-07-04 12:56:52 +01:00
photonstorm
7ebae00c8f Phaser 2.5.1 RC1 2016-07-01 16:57:36 +01:00
photonstorm
32bec66031 Docs update. 2016-06-29 16:18:54 +01:00
photonstorm
4066a8d8d8 All Pixi.Graphics methods that change the Graphics, i.e. drawShape, lineTo, arc, etc will now all automatically call Graphics.updateLocalBounds. This is so that the bounds of the Graphics object are kept updated, allowing you to scale and rotate the Graphics object and still obtain correct dimensions from it (thanks @kelu-smiley #2573) 2016-06-29 16:18:54 +01:00
Richard Davey
fdcbb9229b Phaser.ArrayUtils.shift is the opposite of ArrayUtils.rotate. It takes an array, removes the element from the end of the array, and inserts it at the start, shifting everything else 1 space in the process. 2016-06-29 02:08:42 +01:00
Richard Davey
1f570b49e8 Phaser.Utils.pad now calls toString on the input given, which means you can pass in common data typs such as numbers and have them padded and returned as strings. 2016-06-29 00:04:22 +01:00
Richard Davey
fbd1ba05f7 Phaser.Utils.reverseString will take the given string, reverse it, and then return it. 2016-06-27 22:43:53 +01:00
Richard Davey
a0c771d47e Text.setText has a new optional argument immediate which will re-create the texture immediately upon call, rather than wait for the next render pass to do so (thanks @Scraft #2594) 2016-06-27 22:42:01 +01:00
photonstorm
b24de1e561 Polygon.contains would only work with non-flattened Polygon objects. It now works with both flat and non-flat Polygons.
Graphics objects enabled for input would fail to do anything if a Phaser Polygon was given to the Graphics object (which it was in nearly all cases), as it wouldn't detect input correctly with flattened polygons (thanks @symbiane #2591)
2016-06-27 14:51:25 +01:00
Richard Davey
8c5cea066a Updated docs. 2016-06-23 00:45:24 +01:00
Richard Davey
e050c39357 Gamedevs do it in the render method. 2016-06-22 19:30:30 +01:00