Commit graph

1186 commits

Author SHA1 Message Date
photonstorm
159f49d5bf Experimenting with generateTexture fixes for Canvas. 2015-07-30 17:17:31 +01:00
photonstorm
fc83dc6bdf Tween.frameBased allows you to control if a Tween updates based on the physics step (i.e. frame based) or the system clock (time based). A frame based tween will use the physics elapsed timer when updating. This means it will retain the same consistent frame rate, regardless of the speed of the device. The duration value given should be given in frames. If the Tween uses a time based update (which is the default) then the duration is given in milliseconds. In this situation a 2000ms tween will last exactly 2 seconds, regardless of the device and how many visual updates the tween has actually been through. 2015-07-30 15:27:51 +01:00
photonstorm
c032d57183 Loader.images is a new method that allows you to pass an array of image keys, and optionally the urls, to the Loader and have them all added to the load queue in one go. 2015-07-30 15:01:52 +01:00
photonstorm
1393c8a98b InputHandler.pointerOver would get stuck in an 'isOver' state if the Sprite changed its visibility during an onUp callback (thanks @Cristy94 #1955) 2015-07-30 14:45:34 +01:00
photonstorm
a4321e56e3 * Pointer.isDown was reset before the Input.onUp event, meaning you couldn't get the Pointer.duration from within the event.
* Pointer.isDown was reset before the Input tap calculations, meaning onTap wouldn't dispatch (thanks @stovenator #1953)
2015-07-30 14:08:26 +01:00
photonstorm
6139071ebc Preparing for 2.4.3 dev. 2015-07-29 15:14:40 +01:00
photonstorm
4b22f48c75 2.4.2 release. 2015-07-29 15:01:04 +01:00
photonstorm
962066102c Pointer fixes for Linux FireFox (#1932 #1944) 2015-07-28 14:18:36 +01:00
photonstorm
a8934c392d Phaser.Sound will now automatically check the Cache to see if the audio file it is using is still there or not. If not then it will automatically called Sound.destroy on itself. If you do not desire this result then you should ensure that you undertake all house-keeping yourself, and properly destroy Sound objects _before_ calling Cache.removeSound (#1946) 2015-07-27 14:02:04 +01:00
photonstorm
fd6c29e451 Pointer.move would accidentally reset the isDown status of the Pointer on touch devices, which broke things like Sprite input events when built to native apps or run locally (#1932 #1943) 2015-07-27 13:34:06 +01:00
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