Commit graph

1266 commits

Author SHA1 Message Date
photonstorm
4c97129916 Updating 2015-07-23 13:25:08 +01:00
Richard Davey
1e6f83dbd3 Preparing for 2.4.1 development. 2015-07-22 17:26:12 +01:00
photonstorm
858ad51610 Phaser 2.4 release. 2015-07-22 15:31:30 +01:00
photonstorm
8eb34f96ce WebGL context loss and restoration is now handled directly by Phaser.
Cache.clearGLTextures empties out all of the GL Textures from Images stored in the cache. This is called automatically when the WebGL context is lost and then restored.
2015-07-22 12:59:32 +01:00
photonstorm
915a757f96 Text.updateText will now check the width and height values of the Text canvas and if either are zero it sets Text.renderable = false to avoid throwing WebGL texture binding errors. 2015-07-22 12:43:43 +01:00
photonstorm
f15fe6706c All undefined argument checks were changed from if (typeof x === 'undefined') to if (x === undefined) removing the typeof check and saving some bytes across the codebase in the process. 2015-07-22 10:37:15 +01:00
Richard Davey
9e38bf974a World.stateChange is a new method that is called whenever the state changes or restarts. It resets the world x/y coordinates back to zero and then resets the Camera.
Sprites with Arcade Physics bodies that had `collideWorldBounds` enabled would be moved to the wrong position if you restarted a State (or swapped to a new State) that reset the world bounds (thanks @vulvulune #1775)
2015-07-22 01:24:26 +01:00
Richard Davey
356864ff8a TweenData.update now uses the Time.elapsedMS value for its delta calculation, instead of the physicsStep - this is because tweens are inherently time duration based and on a lagging system they were not properly completing when they should do (also addresses #1819) 2015-07-22 00:09:06 +01:00
Richard Davey
b906463189 Internally the Time class has been updated to split out the RAF and SetTimeout implementations. This cuts down the update loop workload significantly, which was causing a performance optimization bottleneck in V8. 2015-07-21 21:41:26 +01:00
photonstorm
05914d3a95 Preparing readme for release. 2015-07-21 17:07:40 +01:00
photonstorm
ee59425be3 RC3 2015-07-21 15:19:26 +01:00
photonstorm
cf74eaa396 MSPointer now checks the pointerType property of the DOM event and if it matches 'mouse' it will update Input.mousePointer, rather than Input.pointer1 (or whatever the next free Pointer was). 2015-07-20 14:01:21 +01:00
photonstorm
7ffbeb8a2a Added Mouse consts back in (#1903) 2015-07-20 12:38:41 +01:00
photonstorm
b470601faf Tidying up docs. 2015-07-17 17:50:53 +01:00
photonstorm
a7f17394a4 Readme Update. 2015-07-16 16:40:12 +01:00
Richard Davey
9c588d94e8 PIXI.BitmapText has been removed as a global array, as it is no longer used. 2015-07-16 01:29:32 +01:00
Richard Davey
9314c5a767 LoaderParser.bitmapFont, xmlBitmapFont and jsonBitmapFont all now return the font data rather than write it to the now deprecated PIXI global font cache. 2015-07-16 01:17:03 +01:00
Richard Davey
3c7293ab57 Updated AnimationParser and fixed LoadTexture calls. 2015-07-16 01:02:59 +01:00
Richard Davey
bab50d7c88 * The Cache has been internally refactored considerably. Image data is now all stored in the same object, rather than being split across the PIXI global caches (such as PIXI.TextureCache and PIXI.BaseTextureCache), which are no longer used by Phaser.
* Internally the Cache now uses a single _cache object, which is partitioned to store the various different object types. Before the cache used lots of private objects, one per data type, but it's now a lot cleaner and we've managed to cut out hundreds of lines of duplicate code in the process.
* Cache.getImage has a new argument which lets you return either just the HTML Image element or the entire image cache object, which includes the baseTexture and frame data.
* Cache.getImage will return a __default image if the key isn't given, or a __missing image if the key is given but not found in the cache. This means it will always return a valid image and no longer cause Phaser to throw runtime errors deeper down with invalid image objects.
2015-07-16 00:46:28 +01:00
Richard Davey
c6f89737cb The Cache has been internally refactored considerably. Images are now no longer grouped in a single Images cache, but split based on their type. For example you can now load an image called 'fire' and a texture atlas called 'fire' at they are placed into unique caches, where-as before you had to be careful not to use the same keys for anything using an image.
Internally the Cache now uses a single _cache object, which is partitioned to store the various different object types. Before the cache used lots of private objects, one per data type, but it's now a lot cleaner and we've managed to cut out hundreds of lines of duplicate code in the process.
2015-07-15 23:28:13 +01:00
photonstorm
a0d57544c7 P2 updates finished. 2015-07-13 14:48:33 +01:00
photonstorm
956fa493a6 The P2.Body.onBeginContact arguments have changed. It now sends 5 arguments: The Phaser.P2.Body, the p2.Body, the p2 Shape from Body A, the p2 Shape from Body B and the contact equations array. Note that the Phaser.P2.Body may be null if you collide with a 'native' p2 body (such as the world bounds). However the p2.Body argument will always be populated.
The P2.Body.onEndContact arguments have changed. It now sends 4 arguments: The Phaser.P2.Body, the p2.Body, the p2 Shape from Body A and the p2 Shape from Body B. Note that the Phaser.P2.Body may be null if this is the end of a contact with a 'native' p2 body (such as the world bounds). However the p2.Body argument will always be populated.

Upgraded to p2.js 0.7.0
2015-07-13 11:44:04 +01:00
Richard Davey
502dd548fb Loader.path is a string and if set it is placed before any _relative_ file path given to the Loader. For example: load.path = "images/sprites/"; followed by load.image("ball", "ball.png"); and load.image("tree", "level1/oaktree.png"); would load the ball file from images/sprites/ball.png and the tree from images/sprites/level1/oaktree.png. The path is added before the filename but *after* the Loader.baseURL. The path _must_ end with a "/". Set it to nothing to disable the path. 2015-07-12 23:43:35 +01:00
Richard Davey
44c650f6e7 PIXI.DisplayObject.updateTransform now nulls the _currentBounds property (thanks @gaufqwi #1906) 2015-07-12 12:01:38 +01:00
Richard Davey
b0a8d3d78c Mouse.button and MSPointer.button properties removed and jsdocs expanded to explain the correct path to now take (#1903) 2015-07-12 11:47:20 +01:00
Richard Davey
4dec046c40 Added pendingDestroy to Groups. 2015-07-12 11:33:30 +01:00
photonstorm
6e84207331 Readme update. 2015-07-10 17:35:13 +01:00
photonstorm
d3525950a2 Group.addMultiple if given a Group.children array as the first parameter would fail as the original group length was decreased out of line with the children being added. Group.addMultiple now checks if the children argument is a Phaser.Group instance, and if so it uses Group.moveAll instead on it (thanks @AnderbergE #1898)
Group.moveAll allows you to move all of the children of a Group into another Group.
2015-07-10 17:05:54 +01:00
Richard Davey
8e92c13412 Canvas.setSmoothingEnabled only applies the value of the property exists, which avoids the Chrome webkit prefix deprecation warnings. 2015-07-10 04:02:21 +01:00
Richard Davey
f65bca1026 All Signals now have the ability to carry extra custom arguments with them, which are passed on to the callback you define after any internal arguments. For example a Phaser.Key has an onDown signal. When dispatched onDown sends a reference to the Key as the first and only argument. But you can now set the callback like this: fireKey.onDown.add(shoot, this, 0, 'lazer', 64). So when the onDown signal is dispatched internally the callback (shoot in this case) will receive 3 arguments: the Key reference that is raised internally and the string 'lazer' and value 64, which were the custom arguments provided when setting-up the callback. 2015-07-09 21:15:00 +01:00
photonstorm
918e00b868 Added Phaser.Keyboard.COMMA and Phaser.Keyboard.PERIOD to the consts list. 2015-07-09 14:31:18 +01:00
photonstorm
89c87bc9db Updated addKeys to take an object instead of 2 arrays - it's just cleaner and reads easier in code. 2015-07-09 14:28:58 +01:00
photonstorm
5ad3698703 BitmapData.clear has 4 new optional parameters: x, y, width and height, that define the area to be cleared. If left undefined it works exactly the same as before and clears the entire canvas. 2015-07-09 11:44:21 +01:00
Richard Davey
d027bf8ba7 BitmapData.generateTexture will take a snapshot of the BitmapDatas canvas at that moment in time and convert it into an Image, which is then stored in the Phaser image Cache based on the key given. You can then use the new texture for any future sprites or texture based objects. 2015-07-09 00:19:07 +01:00
Richard Davey
3590272c51 All Game Objects have a new boolean property called pendingDestroy. If you set this to true then the object will automatically destroy itself in the *next* logic update, rather than immediately. This is useful for cases when you wish to destroy an object from within one of its own callbacks, such as with buttons or other input events (thanks @alamboley #1748) 2015-07-08 18:52:01 +01:00
photonstorm
1b5da312d0 RandomDataGenerator.weightedPick has been tweaked slightly to allow for a more even distribution of weights. It still favors the earlier array elements, but will accurately include 'distance' elements as well (thanks @gingerbeardman #1751) 2015-07-08 17:20:36 +01:00
photonstorm
64b1794d67 Rope.segments used the wrong vertices property, causing a runtime error.
Debug.ropeSegments didn't take the scale of the Rope object into consideration, causing incorrect debug rendering.
2015-07-08 16:40:26 +01:00
photonstorm
b9dcf74726 If the device is detected as a Windows Phone the renderer is automatically set to use Canvas, even if WebGL or AUTO was requested (thanks @ramarro123 #1706) 2015-07-08 15:25:52 +01:00
photonstorm
0f31358724 Device.windowsPhone should now correctly identify Windows Phone 8.1 devices, which also think they are iOS and Androids. If you find a device that gets around this check please send us its ua string! (thanks @jounii #1496) 2015-07-08 15:22:32 +01:00
photonstorm
1281bc52d7 Setting the scaleMode property of a Game configuration object would cause a ScaleManager TypeError in the resize method. It now stores the scale mode locally and applies it after boot (thanks @Mickawesomesque #1534) 2015-07-08 14:52:20 +01:00
photonstorm
3012e49937 Text.addColor would incorrectly color the text stroke if set (thanks @llevkin #1893
Text.addStrokeColor works in the same way as `Text.addColor` but allows you to define a color stop for the stroke color instead of the fill color.
2015-07-08 12:52:39 +01:00
Richard Davey
86cac2085c BitmapData.move(x, y) allows you to shift the contents of the BitmapData horizontally and vertically by the given amounts. The image wraps-around the edges of the BitmapData.
BitmapData.moveH(distance) allows you to horizontally shift the BitmapData with wrap-around the edges.

BitmapData.moveV(distance) allows you to vertically shift the BitmapData with wrap-around the edges.
2015-07-08 04:26:28 +01:00
Richard Davey
a7e18137d1 Text has a new style property: tabs. This allows you to specify a pixel value (or values) that allows you to space out text that contains tab characters within it. Text.tabs can be either an integer, in which case all tabs share the same spacing, or an array of pixel values corresponding exactly to the number of tabs per line of text. This allows you to easily align columns of data in a single Text object. 2015-07-08 01:15:31 +01:00
photonstorm
157df30696 Pointer button handling has been given an overhaul. It has the following new boolean properties: leftButton, rightButton, middleButton, backButton, forwardButton and eraserButton. So you can now easily check which buttons are active and build right or middle click support into your games. The Pointer object normalises these properties for you, regardless if they came from a MouseEvent or PointerEvent (thanks @youssefdetovernickr for the idea #1848) 2015-07-07 16:53:56 +01:00
photonstorm
9548fb9856 Final textBounds updates. 2015-07-07 15:16:23 +01:00
Richard Davey
92f2742a26 When reusing a Tween created with an array of properties the values would get exponentially added to the TweenData internal array each time the tween was re-run (thanks @SBCGames #1747) 2015-07-07 04:21:55 +01:00
Richard Davey
6a9fd4de8d Debug.currentAlpha wasn't being used to set the alpha of the Debug context at all (was always set to 1) but now updates the alpha of the Debug context before anything is rendered to it (thanks @wayfu #1888) 2015-07-07 03:32:11 +01:00
Richard Davey
06658fa1e0 TilemapLayer.resize allows you to resize a TilemapLayer. It will update the internal canvas object and corresponding texture dimensions (#1881) 2015-07-07 03:27:28 +01:00
Richard Davey
f57d3c19e9 P2.Body.createGroupCallback incorrectly referenced the _groupCallbackContext when deleting it (thanks @Langerz82 #1886) 2015-07-07 01:24:26 +01:00
photonstorm
ab092c5c14 Keyboard.addKeys is a practical way to create an object containing user selected hotkeys. For example: addKeys( [Phaser.Keyboard.W, Phaser.Keyboard.S, Phaser.Keyboard.A, Phaser.Keyboard.D], [ 'up', 'down', 'left', 'right' ] ); would return an object containing the properties up, down, left and right that you could poll just like a Phaser.Key object. (thanks @Mourtz #1857) 2015-07-02 14:15:06 +01:00
photonstorm
698167a596 Tiled Image Collection support is now available and has been added to the TilemapParser and Tilemap classes (thanks @asyed94 #1879) 2015-07-02 13:53:02 +01:00
photonstorm
a89d48b9a6 Text.autoRound allows you to control if the text is allowed to render at sub-pixel coordinates or not. Set to true to round the coordinates, often eliminating anti-aliasing from certain font types (#1867) 2015-07-02 13:39:59 +01:00
photonstorm
ce405acb02 jsdoc update #1864 2015-07-02 13:31:26 +01:00
photonstorm
29f9eeabc6 RenderTexture now takes the display objects alpha into consideration when rendering it, before it would always reset worldAlpha to 1 before rendering, thus ignoring any alpha that may be set. 2015-07-02 13:28:44 +01:00
photonstorm
1ed33cb06c Setting mute to false on Sound that was never muted caused its volume to be set to zero (thanks @brianbunch #1870) 2015-06-24 15:54:25 +01:00
photonstorm
a69c156526 The Text Bounds is a rectangular region that allows you to align your text within it, regardless of the number of lines of text or position within the world. For example in an 800x600 sized game if you set the textBounds to be 0,0,800,600 and text alignment to 'left' and vertical alignment to 'bottom' then the text will render in the bottom-right hand corner of the game, regardless of the size of font you're using or the number of lines in the text itself.
Set the Style properties `boundsAlignH` and `boundsAlignV` or adjust them via the Text setters to change the alignment.

It works by calculating the final position based on the Text.canvas size, which is modified as the text is updated. Some fonts have additional padding around them which you can mitigate by tweaking the Text.padding property.

Setting a textBounds _doesn't_ update the wordWrapWidth, so be aware of the relationship between the two.

Call this method with nothing defined for any of the parameters to reset an existing textBounds.

#1824
2015-06-17 17:18:04 +01:00
photonstorm
0258245f12 Phaser.Text no longer extends PIXI.Text but replaces it entirely. Phaser.Text now natively extends a Phaser Sprite, meaning it can be enabled for physics, damaged, etc. 2015-06-17 13:21:28 +01:00
photonstorm
102c74e121 Deprecated the following:
* Camera.screenView
* ScaleManager.maxIterations
* ScaleManager.enterPortrait (see onOrientationChange)
* ScaleManager.enterLandscape (see onOrientationChange)
* ScaleManager.enterFullScreen (see onFullScreenChange)
* ScaleManager.leaveFullScreen (see onFullScreenChange)
* ScaleManager.fullScreenFailed (see onFullScreenError)
* ScaleManager.checkResize
* ScaleManager.checkOrientation
* ScaleManager.setScreenSize (see updateLayout)
* ScaleManager.setSize (see reflowCanvas)
* ScaleManager.checkOrientationState (see reflowCanvas)
* ScaleManager.orientation (see screenOrientation)
* Gamepad.disabled (see enabled)
* Input.currentPointers (see totalActivePointers)
* Input.disabled (see enabled)
* Keyboard.disabled (see enabled)
* Mouse.disabled (see enabled)
* Mouse.mouseMoveCallback (see Input.addMoveCallback)
* MSPointer.disabled (see enabled)
* Touch.disabled (see enabled)
* Cache.getUrl (see getURL)
* Math.truncate (see Math.trunc)
* Math.snapToInArray (see Phaser.ArrayUtils.findClosest)
* Math.interpolateFloat (see Math.linear)
* Math.normalizeLatitude (use Phaser.Math.clamp(lat, -90, 90))
* Math.normalizeLongitude (use Phaser.Math.wrap(lng, -180, 180))
* Math.chanceRoll (use Phaser.Utils.chanceRoll)
* Math.numberArray (use Phaser.ArrayUtils.numberArray)
* Math.numberArrayStep (use Phaser.ArrayUtils.numberArrayStep)
* Math.limitValue (use Phaser.Math.clamp)
* Math.randomSign (use Phaser.Utils.randomChoice(-1, 1))
* Math.angleLimit (use Phaser.Math.clamp)
* Math.getRandom (use Phaser.ArrayUtils.getRandomItem)
* Math.removeRandom (use Phaser.ArrayUtils.removeRandomItem)
* Math.floor (use Math.trunc)
* Math.ceil (use Phaser.Math.roundAwayFromZero)
* Math.shift (use Phaser.ArrayUtils.rotate)
* Math.shuffleArray (use Phaser.ArrayUtils.shuffle)
* Math.distanceRounded (do the rounding locally)
* Canvas.getOffset (see Phaser.DOM.getOffset)
* Canvas.getAspectRatio (see Phaser.DOM.getAspectRatio)
* TilemapLayer.tileColor (use TilemapLayer.debugSettings.missingImageFill)
* Phaser.ArrayList alias removed, now use Phaser.ArraySet
* Utils.transposeArray (see Phaser.ArrayUtils.transposeMatrix)
* Utils.rotateArray (see Phaser.ArrayUtils.rotateMatrix)
* Utils.shuffle (see Phaser.ArrayUtils.shuffle)
2015-06-17 03:14:31 +01:00
photonstorm
8cf28fede7 maxHealth is a new property that Game Objects with the Health component receive and works in combination with the heal method to ensure a health limit cap. 2015-06-17 02:00:04 +01:00
photonstorm
b725c25702 Button game objects now have Input.useHandCursor set to true by default. 2015-06-17 01:55:36 +01:00
photonstorm
e28eb7b390 Docs update. 2015-06-17 01:55:36 +01:00
photonstorm
40802314dd TileSprite now fully supports animation again, having been broken for several versions due to a Pixi upgrade. We've updated the way TileSprites generate their textures internally considerably and animation support is back across both Canvas and WebGL as a result (#1653) 2015-06-17 01:25:56 +01:00
Richard Davey
14733e9b90 Tilemap.addTilesetImage can now accept a BitmapData as the key parameter and will use the BitmapData to render the tileset with instead of an image from the cache (thanks to @unstoppablecarl for the idea #1838) 2015-06-16 23:17:46 +01:00
photonstorm
30a35227da Formatting update. 2015-06-16 20:38:18 +01:00
photonstorm
17831e0103 P2.Body.loadPolygon now allows the key parameter to be passed as null - when this happens the object parameter can be the actual physics object data instead of a string pointing to the cache, allowing you to take advantage of adding multiple convex shapes with automatic adjustments for center of mass #1801 2015-06-16 19:02:28 +01:00
photonstorm
b481402ae4 Due to a Pixi 2 issue TileSprite when running under WebGL didn't respect the world alpha setting and would only work with its own alpha (thanks @hanenbro #1774) 2015-06-16 17:03:19 +01:00
photonstorm
1990bce48b Sound.restart and Sound.stop now properly disconnect the sound from the gainNode (or external node) before stopping it, allowing restart to work correctly (thanks @eofs #1796) 2015-06-16 16:24:47 +01:00
photonstorm
00cf44eb22 If running under Cordova and iOS the Game.lockRender boolean will be set to true when the game pauses and false when it resumes. This avoids the gpus_ReturnNotPermittedKillClient app crash on iOS (thanks @cncolder #1800) 2015-06-16 14:54:42 +01:00
photonstorm
ab8c98676e Sound.resume wouldn't properly restart looped sounds in Chrome after being paused. Phaser now specifically handles the Chrome 42 bug and later fix (thanks @nkovacs #1820) 2015-06-16 14:28:46 +01:00
photonstorm
f5369628ce Device.chromeVersion will return the major version number of Chrome. 2015-06-16 14:16:04 +01:00
photonstorm
732b80813e Line.rotate allows you to rotate a line by the given amount around its center point. 2015-06-13 05:20:43 +01:00
photonstorm
9e78cd1d7a Rectangle.random will return a uniformly distributed random point from anywhere within the rectangle. 2015-06-13 04:18:50 +01:00
photonstorm
77e7b2af9b Ellipse.random will return a uniformly distributed random point from anywhere within the ellipse. 2015-06-13 03:46:20 +01:00
photonstorm
3daea179fb Line.random will return a random point from anywhere on the Line segment. 2015-06-13 03:04:02 +01:00
photonstorm
9212c01dae Returns a random point from anywhere within this circle. 2015-06-12 19:15:56 +01:00
photonstorm
af42f5d4c9 Cache.getJSON has a new parameter: clone. If set it will return a clone of the object stored in the Cache rather than a reference to it. 2015-06-12 12:16:58 +01:00
photonstorm
681d8679e7 Rectangle.resize allows you to resize a Rectangle to the new given dimensions without altering its position. 2015-06-11 06:01:29 +01:00
photonstorm
2b0abb67dd onDragUpdate is a new signal that is dispatched whenever a Game object enabled for input and drag is moved by a pointer (i.e. during a drag event). See the Phaser.InputHandler.enableDrag docs for parameter details and the new Phaser Example. 2015-06-04 20:58:00 +01:00
photonstorm
eec99db8a9 Readme update. 2015-06-04 04:24:02 +01:00
photonstorm
ed82097151 Removed un-necessary PIXI.TextureCache pollution in Phaser.LoaderParser.bitmapFont. 2015-06-03 05:28:23 +01:00
photonstorm
76e2b00c82 Fixed pad jsdoc and ts defs (#1823) 2015-06-02 19:53:30 +01:00
photonstorm
cc5740af10 BitmapText line spacing and word wrapping has been vastly improved and bought in-line with how Pixi 3 handles it, but with additional anchor support. 2015-05-31 01:31:11 +01:00
Richard Davey
187d947c29 Merge pull request #1806 from joshtepei/patch-2
Fixed a comma error in README.md
2015-05-30 20:02:59 +01:00
photonstorm
1438248388 Group.add and Group.addAt will only create a Physics Body on the child if it doesn't already have one. This is a change from 2.3 where it would replace the physics body property with the new body, but this could lead to garbage build-up over time, so you should now properly destroy the body before changing it. 2015-05-29 00:59:23 +01:00
photonstorm
3ad60b815b Docs update. 2015-05-27 18:07:38 +01:00
photonstorm
83b533557d Docs update. 2015-05-26 20:01:57 +01:00
photonstorm
f2636a155a Readme update. 2015-05-22 15:10:27 +01:00
photonstorm
312c31b778 jsdoc and formatting fixes. 2015-05-21 11:53:18 +01:00
Josh Tepei
6bf44a859c Fixed a grammar error in README.md
Added a comma for further clarity on line 54 of README.md
2015-05-20 14:23:33 -07:00
photonstorm
5a91f85b1f Typo. 2015-05-19 16:57:36 +01:00
photonstorm
ab594e930b Readme update. 2015-05-19 16:09:19 +01:00
photonstorm
c3d123641b Readme update. 2015-05-19 14:53:38 +01:00
photonstorm
0f6dd1a1a6 Device.firefoxVersion is a new property that contains the major Firefox version number if running within Firefox, otherwise zero. 2015-05-18 14:51:25 +01:00
photonstorm
bd44a25212 Readme updates. 2015-05-18 12:55:48 +01:00
photonstorm
5a149ea4ec Docs updates. 2015-05-14 16:52:09 +01:00
photonstorm
f7514dc979 Docs updates. 2015-05-12 13:03:27 +01:00
photonstorm
7b938f396e Rectangle.bottomLeft has been added (thanks @mattmogford #1788) 2015-05-12 13:03:26 +01:00
photonstorm
4a4d7d594c Docs updates. 2015-05-08 04:15:03 +01:00
photonstorm
25178fdf85 Docs update. 2015-05-08 01:51:18 +01:00
photonstorm
af66b49f31 If a BitmapData is created with a width or height set to zero then the width and/or height are set to a default value (256) instead to avoid getContext errors. 2015-05-06 16:50:10 +01:00
photonstorm
f623e68eb7 Docs updates. 2015-05-06 01:12:09 +01:00
photonstorm
9aa022ba8e Docs update. 2015-05-05 17:03:44 +01:00
photonstorm
9ce76fcef8 Docs update. 2015-05-05 16:25:57 +01:00
photonstorm
33ece1fc52 Readme updates. 2015-05-05 14:02:10 +01:00
photonstorm
159a3f2f40 Readme updates. 2015-05-03 13:53:03 +01:00
photonstorm
df3c684760 PIXI.BaseTexture.forceLoaded allows you to set a BaseTexture as loaded, with the given width and height. It then calls BaseTexture.dirty. This is important for when you don't want to modify the shape of the source object by forcing in complete or dimension properties it may not naturally have, but still wish to use it as a base texture. 2015-05-03 13:53:02 +01:00
photonstorm
3f51463c7b PIXI.CanvasTinter.tintWithMultiply was performing a double drawImage operation for no reason. Simplified down to a single drawImage call. 2015-05-03 13:53:02 +01:00
photonstorm
e291f6d590 Added type parameter to VideoTexture.fromUrl allowing you to define the mime-type of the video file, which is required for Firefox and Safari in most cases. 2015-04-29 14:41:47 +01:00
photonstorm
da0bd86c26 Rectangle.ceil runs Math.ceil() on both the x and y values of the Rectangle.
Rectangle.ceilAll runs Math.ceil() on the x, y, width and height values of the Rectangle.
2015-04-29 13:13:11 +01:00
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