Commit graph

1401 commits

Author SHA1 Message Date
photonstorm
b008fc7216 Readme update. 2016-04-28 00:18:08 +01:00
photonstorm
16378713b4 JSDocs update (#249) 2016-04-27 12:57:41 +01:00
photonstorm
f494c867c7 Fixed an issue in the Arcade Physics overlap method where it would only detect overlaps up to the max bias threshold and no further (thanks @rgk #2441)
The Arcade Physics overlap method would return false if two bodies were overlapping but neither had any velocity (i.e. they were embedded into each other)
2016-04-25 11:38:51 +01:00
photonstorm
620b95e510 Updated docs and TS defs re: #2443 2016-04-23 04:36:47 +01:00
photonstorm
6bc93de7a5 Preparing for 2.4.8 dev. 2016-04-23 04:32:47 +01:00
photonstorm
a29cc64932 Phaser 2.4.7 Final. 2016-04-22 15:15:28 +01:00
photonstorm
b441ee315f Docs update. 2016-04-22 11:56:06 +01:00
photonstorm
7d9c817373 Dragging a Sprite while the camera was moving would slowly cause the Sprite position to become out of sync the further the camera moved. A Sprite being dragged now tracks the camera position during the drag update and adjusts accordingly (thanks @jeroenverfallie #1044) 2016-04-19 01:54:24 +01:00
photonstorm
628dd1c420 P2.Body.offset is now used and applied to the Sprite position during rendering. The values given are normal pixel values, and offset the P2 Body from the center of the Sprite (thanks @Mourtz #2430) 2016-04-18 20:57:41 +01:00
photonstorm
a2d145a43d When the Loader loads audio via the Audio tag, instead of Web Audio, it used to use Phaser.GAMES[_this.game.id].load as the callback handler, which would stop it from working if you had multiple Loaders set-up within Phaser. It now uses a local reference to _this instead (thanks @SBCGames #2435) 2016-04-18 16:44:28 +01:00
photonstorm
257a22b170 When loading Video with the asBlob argument set it now uses a 'blob' type for the XHR loader, and doesn't cast the resulting file as a Blob upon load. This fixes loading videos as blobs on Chrome for Android (thanks @JuCarr #2433) 2016-04-18 16:17:27 +01:00
photonstorm
41add1b4bf Phaser 2.4.7 RC1. 2016-04-14 13:23:44 +01:00
photonstorm
aad499b025 Tidying up the code base for 2.4.7. 2016-04-14 12:43:10 +01:00
photonstorm
5221bfd5da You can now pass in your own Canvas element to Phaser and it will use that instead of creating one itself. To do so you must pass a Game Configuration object to Phaser when you instantiate it, and set the canvas property of the config object to be the DOM element you wish to use, i.e.: { canvas: document.getElementById('yourCanvas') } (thanks @Friksel #2311) 2016-04-14 11:57:10 +01:00
photonstorm
48ff74b718 Text update. 2016-04-14 11:48:08 +01:00
photonstorm
150e443875 Docs update to include browserify info #2424 2016-04-13 16:05:03 +01:00
photonstorm
1f8e352b7c Docs update. 2016-04-13 15:44:21 +01:00
photonstorm
a6528aa9fc Docs fix. 2016-04-13 15:44:21 +01:00
photonstorm
d04a6ec402 Docs update. 2016-04-12 02:21:02 +01:00
photonstorm
f4277efc20 Alternative snooker-ball like collision test. 2016-04-11 16:43:17 +01:00
photonstorm
7102a34706 Camera.flash is a new function that makes the camera 'flash' over the top of your game. It works by filling the game with the solid fill color specified, and then fading it away to alpha 0 over the duration given. This is great for things like hit effects. You can listen for the Camera.onflashComplete Signal.
Camera.fade is a new function that makes the camera fade to the color given, over the course of the duration specified. This is great for things like transitioning from one State to another. You can listen for the Camera.onFadeComplete Signal.

Camera.resetFX resets any active FX, such as a fade or flash and immediately clears it. Useful to calling after a fade in order to remove the fade from the Stage.

Phaser.Camera.ENABLE_FX is a const that controls if the Camera FX are available or not. It's `true` by default, but if you set it to `false` before boot then it won't create the Graphics object required to process the effects.
2016-04-09 04:05:07 +01:00
photonstorm
2ea94c83e6 Camera.shake is a new function that creates a camera shake effect. You can specify the intensity, duration and direction of the effect. You can also set if it should shake the camera out of bounds or not. 2016-04-09 02:57:16 +01:00
photonstorm
dba84d5931 Camera has a new property: lerp. This is a Point object, that allows you to control the amount of horizontal and vertical smoothing to be applied to the camera when it tracks a Sprite. It works both with and without deadzones, and is turned off by default. Set it to low values such as 0.1 for really smooth motion tracking (thanks to @WombatTurkey for the idea of adding this) 2016-04-09 01:07:19 +01:00
photonstorm
cc5361dd6d World.separate has been optimized to cut down on the number of calls to intersect from 3 calls per Game Object collision check, to 2. So if you were colliding 50 sprites it will reduce the call count from 150 to 100 per frame. It also reduces the calls made to seperateX and seperateY by the same factor.
Two immovable bodies would never set their overlap data, even if an overlap only check was being made. As this is useful data to have this has been changed. Two immovable bodies will still never separate from each other, but they _will_ have their `overlapX` and `overlapY` properties calculated now.
2016-04-07 18:04:45 +01:00
photonstorm
50e126f59e * Body has two new properties: left and top. These are the same as Body.x and Body.y but allow you to pass the Body to geometry level functions such as Circle.contains.
* Body.setCircle allows you to define a Body as using a circle to collide with instead of a rectangle. You can set the radius of the collision circle and an offset.
* Body.render now renders both circle and rectangle body shapes to the Debug canvas.
* World.intersects has been updated to support both circle and rectangle body shapes, and supports quick-paths for circle vs. circle and rect vs. rect checks.
* World.circleBodyIntersects is a new method that checks for intersection between a Body that has been defined as a circle, and a normal rectangle based Body. This is used internally by World.intersects, but exposed for direct calls as well.
2016-04-07 17:01:16 +01:00
photonstorm
b9f62e77e6 You can now pass a TilemapLayer as a Texture to a TileSprite. A limitation of this is that if you pass it to a TileSprite it will make a fill pattern from the TilemapLayer at that instant it's passed, and it won't keep track of the layer in future should it update (thanks @jdnichollsc #1989) 2016-04-07 03:45:21 +01:00
photonstorm
e5ceb7e9bc P2.World.setBounds has been re-written completely. If the World is resized it no longer removes the P2 body instances and re-creates them. Instead it checks to see which walls are required and then just moves the position of the shapes instead, or updates them, or creates or destroys them as required. This is far more efficnent, especially in a game which see's a lot of world bounds changes (i.e. resizes responsively in browser) 2016-04-07 01:56:42 +01:00
photonstorm
5c261821fe P2.World.updateBoundsCollisionGroup didn't set the _boundsOwnGroup private var, meaning the World.setBounds method wasn't able to restore previously set collision masks automatically (thanks @jmp909 #2183) 2016-04-07 01:25:52 +01:00
photonstorm
4d5a037ae5 P2.World.updateBoundsCollisionGroup wouldn't use the boundsCollisionGroup mask if you passed true as the argument, only if it was left undefined. 2016-04-07 01:18:19 +01:00
photonstorm
787111c12c A Game Object with fixedToCamera = true that was then set for Input, and enabled for dragging from its center (input.enableDrag(true)) would throw an error upon being dragged (thanks @solusipse #2367) 2016-04-07 00:44:53 +01:00
photonstorm
fc7b5c79e3 Graphics objects can now have a Physics Body directly attached to them, where-as before it would throw an error due to a lack of anchor property (thanks @NLilley #2400) 2016-04-07 00:14:41 +01:00
photonstorm
896b32a28c SoundManager.muteOnPause is a new boolean that allows you to control if the Sound system gets muted automatically when a Phaser game pauses, such as when it loses focus. You may need to set this to false if you wish to control the audio system from outside of your Phaser game, i.e. from DOM buttons or similar (#2382) 2016-04-06 02:09:22 +01:00
photonstorm
61bc4a8dca Sound.play when using an AudioTag would ignore the muted state of the SoundManager and play regardless. It now checks the SoundManager.mute state on play, and sets the volume accorindingly (thanks @brianbunch #2139) 2016-04-06 01:41:54 +01:00
photonstorm
03ea59940c Docs update. 2016-04-06 01:29:16 +01:00
photonstorm
988290631f When setting a global volume for the SoundManager it would previously incorrectly calculate the volumes of AudioTag based Sound objects that were not played at volume 1. The new approach uses Sound.updateGlobalVolume which adjusts the Sound volume to be a percentage of the global volume. So if the global volume is 0.5 and the Sound volume is 0.5, the Sound will play with an actual volume of 0.25 (thanks @VitaZheltyakov #2325) 2016-04-06 01:19:32 +01:00
photonstorm
4d69b13977 Passing a BitmapData to a TileSprite as a texture would fail if the BitmapData had not been previously added to the cache. It now uses the new frameData property (thanks @mzamateo @lucap86 #2380) 2016-04-06 00:44:55 +01:00
photonstorm
0c2ac47981 Camera.position would return the view rectangles centerX/Y coordinates, instead of view.x/y (which is what Camera.x/y returns), so it has been updated to return view.x/y instead (thanks @kamparR #2120) 2016-04-06 00:18:01 +01:00
photonstorm
ecbff44354 Group.getByName searches the Group for the first instance of a child with the name property matching the given argument. Should more than one child have the same name only the first instance is returned. 2016-04-05 23:59:05 +01:00
photonstorm
65f8f111c8 Game.forceSingleUpdate is now true by default. 2016-04-05 23:40:15 +01:00
photonstorm
4c3a30a6f6 PluginManager.destroy is now called by Game.destroy. 2016-04-05 23:16:52 +01:00
photonstorm
6933b41e6f Arcade.Body's speed property was only set when the body moved, it now updates regardless (thanks @mark-henry #2417) 2016-04-05 23:06:57 +01:00
photonstorm
aee0212e11 Camera.follow now uses the Targets world property to seed the camera coordinates from, rather than its local position. This means Sprites that are members of offset Groups, or transformed display lists, should now be followed more accurately (thanks @rbozan #2106) 2016-04-05 23:04:31 +01:00
photonstorm
8ad7b25595 The Debug canvas now listens for the ScaleManager.onSizeChange signal and resizes itself accordingly when running under WebGL. This means if your game size changes the Debug canvas won't be clipped off (thanks @francisberesford #1919) 2016-04-05 21:52:11 +01:00
photonstorm
b3e6381a9e Tween.update wouldn't dispatch an onLoop signal for Tweens with just one child, such as those created via Tween.to with -1 as the repeat value (thanks @ForgeableSum #2407) 2016-04-05 01:11:50 +01:00
photonstorm
917d9c7060 TweenData.repeatTotal is a new property that keeps track of the total number of times the Tween should repeat. If TweenData.start is called, as a result of the Tween repeatCount being > 0 then the child tween resets its total before re-starting. 2016-04-05 01:06:05 +01:00
photonstorm
f9949166be Text that used fonts which had numbers in their names wouldn't be correctly rendered unless you explicitly set the font property after creation. You can now pass font names with numbers in them as the font style object correctly (thanks @And-0 #2390) 2016-04-04 23:20:04 +01:00
photonstorm
bc4b828b51 BitmapData.copy, and by extension draw, drawFull, drawGroup, etc, would incorrectly handle drawing a tinted Sprite if it was using a frame from a texture atlas (thanks @PhaserDebugger #2405) 2016-04-04 22:53:13 +01:00
photonstorm
12f3bd6cc5 The Destroy component will now call TweenManager.removeFrom, removing any active tweens from the TweenManager upon the Game Objects destructions (thanks @PokemonAshLovesMyTurkeyAndILikeYouTwo #2408)
Tween.update will now return `false` (flagging the Tween for destruction) should the Tween.target property every become falsey. This can happen if the object the Tween was tracking is destroyed, nulled or generally removed..
2016-04-04 22:06:16 +01:00
photonstorm
63b3b3e887 Negative lineSpacing in Text objects will no longer crop the bottom pixels off lines of text (thanks @gaelenh #2379 #2374) 2016-04-04 21:36:37 +01:00
photonstorm
f9ff892510 Formatting. 2016-04-04 21:25:21 +01:00