Commit graph

1176 commits

Author SHA1 Message Date
Richard Davey
1f73bbbe94 Device.canPlayVideo now checks for ogv as a valid file extension for OGG video files (thanks @JB-Tellez #1928) 2015-07-26 13:19:05 +01:00
Richard Davey
50480d815f * Cache.getFrame has a new cache parameter (that defaults to the Image cache, but can be changed to any other)
* Cache.getFrameCount has a new `cache` parameter (that defaults to the Image cache, but can be changed to any other)
* Cache.getFrameData has a new `cache` parameter (that defaults to the Image cache, but can be changed to any other)
* Cache.hasFrameData has a new `cache` parameter (that defaults to the Image cache, but can be changed to any other)
* Cache.getFrameByIndex has a new `cache` parameter (that defaults to the Image cache, but can be changed to any other)
* Cache.getFrameByName has a new `cache` parameter (that defaults to the Image cache, but can be changed to any other)

re: #1935
2015-07-26 13:14:25 +01:00
Richard Davey
2e12cd70ed DeviceButton would try to set altKey, shiftKey and ctrlKey even for Joypads (thanks @zatch #1939) 2015-07-26 13:01:24 +01:00
photonstorm
cef2948ec1 2.4.2 Readme update. 2015-07-24 17:53:17 +01:00
photonstorm
74a8ba0080 Preparing for 2.4.2 dev. 2015-07-24 14:04:30 +01:00
photonstorm
205fe5844d 2.4.1 readme. 2015-07-24 13:25:28 +01:00
photonstorm
444e2cffe5 More tests with the UMD wrapper. 2015-07-24 13:21:33 +01:00
Richard Davey
aeda044143 Safari on OSX wouldn't recognise button presses on trackpads (thanks JakeCake) 2015-07-23 20:54:59 +01:00
photonstorm
1113b8f683 README updated for 2.4.1 changes. 2015-07-23 16:01:16 +01:00
photonstorm
7967d32d52 Creature update. 2015-07-23 13:25:08 +01:00
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