Commit graph

1057 commits

Author SHA1 Message Date
photonstorm
8290e8c371 Text.setShadow has two new optional parameters: shadowStroke and shadowFill. These allow you to set if the drop shadow is applied to the Text stroke, the Text fill or both of them (thanks @qdrj #1766)
Text.shadowStroke and Text.shadowFill allow you to toggle if the drop shadow is applied to the Text stroke or fill independently.
2015-04-27 16:22:36 +01:00
photonstorm
8519c9e394 The Tween.onStart signal wasn't dispatched if the Tween had a delay set. It's now dispatched immediately if no delay, or after the delay if set. It also respects the autoStart parameter and will still dispatch even if autoStart is true. 2015-04-27 16:22:35 +01:00
photonstorm
30450cb9bc Loader.atlas and Cache.addTextureAtlas will now automatically determine the format of the JSON data (array or hash) when added to the Cache. You no longer need to specify it explicitly if JSON, only if XML. 2015-04-23 02:35:09 +01:00
photonstorm
05d0a94116 Phaser.AnimationParser methods JSONData, JSONDataHash and XMLData have all had their cacheKey parameter removed as it's no longer used. 2015-04-21 16:01:11 +01:00
photonstorm
ede76cf4f6 Frame.uuid has been removed (was flagged as deprecated for several releases). This has a two-fold effect: First it means that the property no longer exists and secondly it means that the AnimationParser (the class responsible for loading sprite sheets and texture atlases) no longer has to call either RandomDataGenerator.uuid OR populates the PIXI.TextureCache. The first saves some CPU time and the second saves memory by not creating references to textures it doesn't ever use. The PIXI.TextureCache is now ignored by Phaser other than for the __missing and __default textures. 2015-04-21 15:55:04 +01:00
photonstorm
94b4d5d73c Doc updates. 2015-04-21 05:10:27 +01:00
photonstorm
6c96568dd1 Files can now be added to the Loader with an absolute URL even if you have a Loader.baseURL set. In previous versions the baseURL would still be prepended to the file URL, but the Loader now checks if the a file URL begins with http or // and skips prepending the baseURL to it.
All calls to Loader methods that add files to the queue, such as `Loader.image` or `Loader.atlas`, now have the URL as an optional parameter. If not set Loader will assume the URL to be based on the key given. For example the following: `game.load.image("boom", "boom.png")` can now be expressed as just `game.load.image("boom")`, or `game.load.atlas("player", "player.png", "player.json")` can now be shortened to `game.load.atlas("player")`. Please see the freshly updated jsdocs for full details.
2015-04-21 02:14:41 +01:00
photonstorm
714580f9a9 Manual fix #1752 2015-04-17 17:35:52 +01:00
photonstorm
59beae762d The SoundManager didn't accurately detect devices or browser environments with no sound card present and would try to carry on using a null Web Audio context (thanks @englercj #1746)
SoundManager.pauseAll, resumeAll and stopAll now checks if the SoundManager.noAudio is set and ignores the calls.

SoundManager.usingWebAudio is set to `false` by default (used to be `true`) and is only explicitly set if Web Audio is available and hasn't been disabled in the PhaserGlobal object.

SoundManager.touchLocked is now set to `false` should the device be using legacy Audio, avoiding the unlock call running without need.
2015-04-17 03:49:20 +01:00
photonstorm
2e2ba665cd PIXI.DisplayObject.updateTransform has a new optional parameter parent. If the DisplayObject doesn't have a parent (i.e. it isn't on the display list yet) then in the past updateTransform would fail. This meant you couldn't do things like scale or rotate a Sprite and then draw it to a RenderTexture or BitmapData, as calls to updateTransform would be ignored. The new checks now look to see if the parent parameter is set. If so this takes priority over the actual parent and is used to modify the transform (note that it **doesn't** reparent the DisplayObject, it merely uses it for the transform.) If there is no parent (explicitly or via the parameter) then it falls back to use Phaser.World as the parent. If it can't reach that then no transform takes place. 2015-04-17 03:22:23 +01:00
photonstorm
eca360301c Bumping up the release to 2.4.0 due to the API changes in the State Manager. 2015-04-15 01:37:41 +01:00
photonstorm
9f493044d4 The StateManager would incorrectly call loadUpdate while the game was paused or if the State didn't have an update method defined even after the loader was completed.
The StateManager would incorrectly call `loadRender` while the game was paused or if the State didn't have an `render` method defined even after the loader was completed.
2015-04-14 15:34:32 +01:00
photonstorm
8f06991527 Added support for the [Creature Automated Animation Tool](http://www.kestrelmoon.com/creature/). You can now create a Phaser.Creature object which uses json data and a texture atlas for the animations. Creature is a powerful animation tool, similar to Spriter or Spine. It is currently limited to WebGL games only, but the new libs should prove a solid starting point for anyone wanting to incorporate Creature animations into their games. 2015-04-13 23:16:29 +01:00
photonstorm
0ffa499bd0 Removed getJSON parse parameter. It's already parsed :) 2015-04-13 22:06:57 +01:00
photonstorm
e5f1f6f896 Cache.getPixiTexture will return a PIXI.Texture from the cache based on the given key. A PIXI Texture is created automatically for all images loaded and added to the cache.
Cache.getPixiBaseTexture will return a PIXI.BaseTexture from the cache based on the given key. A PIXI BaseTexture is created automatically for all images loaded and added to the cache.

Cache.getTexture has now been removed (it was deprecated several versions ago). Use Cache.getRenderTexture instead.

Cache.getJSON has a new optional parameter: `parse`. If `true` the method will pass the data through JSON.parse before returning it. The default is `false` to retain backwards compatibility.
2015-04-13 20:25:42 +01:00
photonstorm
615925123a Group would automatically add a child into the _hash array as soon as the child was created (or moved into the Group). This no longer happens. Instead the child is only added to Group.hash if it is enabled for Arcade Physics. However Group.addToHash and the hash array have been exposed in case you were taking advantage of the _hash even though it was a private array.
Enabling Arcade Physics would add the deltaCap property onto Phaser.Time, even though the property doesn't exist any more, changing the class shape in the process.
2015-04-13 16:34:39 +01:00
photonstorm
bd57510528 Group would automatically add a child into the _hash array as soon as the child was created (or moved into the Group). This no longer happens. Instead the child is only added to Group.hash if it is enabled for Arcade Physics. However Group.addToHash and the hash array have been exposed in case you were taking advantage of the _hash even though it was a private array. 2015-04-13 16:32:03 +01:00
photonstorm
432516fa0f Physics.Arcade.sort has a new property 'sortDirection'. If not specified it will use World.sortDirection. If the Group given as the first parameter has its physicsSortDirection property set that will override any other setting.
Physics.Arcade.sort now calls one of four functions: sortLeftRight, sortRightLeft, sortTopBottom and sortBottomTop. Each of which takes 2 Sprites as arguments.

Physics.Arcade.sort now doesn't bail out if the Group contains a mixture of physics and non-physics enabled objects, as the Group hash is now only ever populated with physics enabled objects. Also the sort comparison functions no longer return -1 if the bodies are invalid, but zero instead (#1721)
2015-04-13 16:29:34 +01:00
photonstorm
eb506e2698 PIXI.Graphics in Canvas mode wouldn't respect the objects visible or alpha zero properties, rendering it regardless (thanks @TimvdEijnden #1720) 2015-04-13 14:19:44 +01:00
photonstorm
bb8b0d04fc Graphics.drawPolygon can now accept a Phaser.Polygon or PIXI.Polygon object, as well as a points array (#1712) 2015-04-13 13:00:52 +01:00
photonstorm
f155ad452c Tilemap.createFromObjects has been updated for Tiled 0.11 and can now look-up object layers based on id, uid or name. It will also now copy over Sprite scaling properties if set (thanks @mandarinx #1738) 2015-04-13 12:40:12 +01:00
photonstorm
7b8a430aac TilemapLayer docs incorrectly reported it as extending Phaser.Image, but it doesn't share the same components so has been updated.
TilemapLayer was missing the Input component (thanks @uhe1231 #1700)
2015-04-13 12:23:30 +01:00
photonstorm
04cb3889a9 P2.getConstraints would return an array of null objects. It now returns the raw p2 constraint objects (thanks @valueerrorx #1726) 2015-04-13 12:12:18 +01:00
photonstorm
b41cf3bc8c AnimationManager.frameName setter wasn't checking if _frameData existed before accessing it (thanks @nesukun #1727) 2015-04-13 11:58:45 +01:00
photonstorm
36c064511c Added guards around context.getImageData calls in BitmapData, Text and Canvas Tinting classes to avoid crashing restricted browsers like Epic Browser. Please understand that several Phaser features won't work correctly with this browser (thanks @Erik3000 #1714) 2015-04-02 14:47:44 +01:00
photonstorm
645723f939 Sprite was missing the Health and InCamera components. 2015-03-30 13:51:47 +01:00
photonstorm
5fb1130175 The LoadTexture component has had a redundant dirty call removed from it.
TileSprites were missing a `physicsType` property, causing them to not collide with anything (thanks @numbofathma #1702)
2015-03-28 00:56:02 +00:00
photonstorm
49be59b0c9 Added missing resumed method to Phaser.State class template. 2015-03-26 10:54:32 +00:00
photonstorm
8233b0a079 Phaser 2.3.0. 2015-03-26 02:37:31 +00:00
photonstorm
d4e838592c Readme tweaks. 2015-03-26 02:22:05 +00:00
photonstorm
bd62459a56 Readme release changes. 2015-03-26 02:10:57 +00:00
photonstorm
93dc67be71 Graphics.drawArc would fail to draw any subsequent arcs if you set beginFill on it after drawing the first arc.
Graphics.drawArc would only move to the center position of the first arc created and ignore any subsequent arcs.
Graphics.drawArc now correctly renders multiple arcs across both WebGL and Canvas. You no longer need to specifically call moveTo to move into the correct place to draw the arc.
Graphics.drawArc now bails out if the startAngle = the endAngle and/or the sweep is invalid *before* adjusting any points.
Graphics.drawArc now correctly handles the fill on the CanvasRenderer if the arc is a subsequent arc and no line style is set.
2015-03-25 13:00:08 +00:00
photonstorm
f4d55b7785 When an Emitter is destroyed via Emitter.destroy it now removes itself from the Phaser Particle Manager, freeing it up for garbage collection and stopping it from being processed. 2015-03-25 05:07:39 +00:00
photonstorm
aa13ec0165 Animation.play wouldn't correctly set the play state on the Game Objects AnimationManager causing the animation to fail to start (calling AnimationManager.play did work however), now they're both consistently working. 2015-03-25 03:59:36 +00:00
photonstorm
244372384e When an Animation completes playback and isn't set to loop it would change the currentFrame property to be the first frame in the set after the onComplete callback had fired. This meant if you set a Sprite to a new frame within an Animation onComplete callback then your change would have been overwritten by the animation itself. This is now no longer the case. 2015-03-24 23:17:13 +00:00
photonstorm
d80ec1ae6d Phaser 2.3 Release Candidate 2. 2015-03-24 21:35:23 +00:00
photonstorm
06b484e71c Huge docs update. 2015-03-24 16:01:07 +00:00
photonstorm
96e313e768 If you paused a Sound object that is using audio markers and then resumed it, it wouldn't correctly calculate the resume duration - causing the sound to sometimes play into the marker that followed it (thanks @AnderbergE #1669) 2015-03-24 14:43:35 +00:00
photonstorm
7e19f45350 When the Game first boots it will now call window.focus(). This allows keyboard events to work properly in IE when the game is running inside an iframe. You can stop this from happening by setting window.PhaserGlobal.stopFocus = true (thanks @webholics #1681) 2015-03-24 13:27:27 +00:00
photonstorm
7aa4d0ad0d When a State is started and linked to Phaser it has a new property created on it: key, which is the string identifier used by the State. 2015-03-24 10:21:03 +00:00
photonstorm
3db4313e5d Docs update. 2015-03-23 16:13:04 +00:00
photonstorm
7010883bc3 Tidying up. 2015-03-23 15:07:09 +00:00
photonstorm
4fbb7d2a7e readme updates. 2015-03-23 08:13:59 +00:00
photonstorm
cb9ef4f12e Text.padding specifies a padding value which is added to the line width and height when calculating the Text size. ALlows you to add extra spacing if Phaser is unable to accurately determine the true font dimensions (#1561 #1518) 2015-03-19 01:54:14 +00:00
photonstorm
b13acdb23b TilingSprite.destroy fixed if TilingSprite hasn't ever been rendered (#1663) 2015-03-19 01:39:39 +00:00
photonstorm
5a9b509b44 ArraySet.removeAll allows you to remove all members of an ArraySet and optionally call destroy on them as well.
GameObject.input.dragStartPoint now stores the coordinates the object was at when the drag started. This value is populated when the drag starts. It can be used to return an object to its pre-drag position, for example if it was dropped in an invalid place in-game.
2015-03-19 00:51:13 +00:00
photonstorm
62b2fb51d6 Link changed (fix #1672) 2015-03-18 19:25:12 +00:00
photonstorm
f2b03c8826 Readme updated. 2015-03-18 19:14:58 +00:00
photonstorm
2483cd5df4 Various readonly Body properties flagged as 'readonly' in the jsdocs (#1643) 2015-02-26 23:32:14 +00:00
photonstorm
f99f182a6f Arcade Physics is now using a spacial pre-sort for all Sprite vs. Group and Group vs. Group collisions. You can define the direction the sort will prioritise via the new sortDirection property. By default it is set to Phaser.Physics.Arcade.LEFT_RIGHT. For example if you are making a horizontally scrolling game, where the player starts on the left and moves to the right, then this sort order will allow the physics system to quickly eliminate any object to the right of the players bounds. This cuts down on the sheer volume of actual collision checks needing to be made. In a densely populated level it can improve fps rate dramatically.
There are 3 other directions available (`RIGHT_LEFT`, `TOP_BOTTOM` and `BOTTOM_TOP`) and which one you need will depend on your game type. If you were making a vertically scrolling shoot-em-up then you'd pick `BOTTOM_TOP` so it sorts all objects above and can bail out quickly.

More importantly you can switch the `sortDirection` at run-time with no loss of performance. Just make sure you do it *before* running any collision checks. So if you had a large 8-way scrolling world you could set the `sortDirection` to match the direction the player was moving in and adjust it in real-time, getting the benefits as you go. My thanks to Aaron Lahman for inspiring this update.
2015-02-26 21:24:07 +00:00