Commit graph

636 commits

Author SHA1 Message Date
photonstorm
b979243a8d Removed the cacheKey parameters from the AnimationParser methods as they're no longer used. 2014-06-10 23:50:12 +01:00
photonstorm
7c7d9153e6 Sprite.crop (and Image.crop) has been completely overhauled. You can now crop animated sprites (sprite sheet and texture atlas), you can define the x/y crop offset and the crop rectangle is exposed in the Sprite.cropRect property.
Sprite.updateCrop is available if you wish to update an externally referenced crop rectangle.
Sprites and Images now have their own textures objects, they are no longer references to those stored in the global Pixi.TextureCache. This allows you to redefine the texture frame dynamically without messing up any other Sprites in your game, such as via cropping. They still share global Base Textures, so image references are kept to a minimum.
Sprite.resetFrame will revert the Sprites texture frame back to its defaults dimensions. This is called when you call Sprite.crop with no rectangle, to reset the crop effect, but can be userful in other situations so we've left it as a public method.
2014-06-10 23:37:33 +01:00
photonstorm
6d10be6baa When creating a Sprite or Image using a texture atlas it would set the frame twice, once in loadTexture and once when the initial frame is set. This has been reduced down to just a single setting now. 2014-06-10 11:21:07 +01:00
photonstorm
ee5f6457c8 Swapped to using escaped Unicode characters for the console output. 2014-06-09 16:15:41 +01:00
photonstorm
9aa10f7521 Sound.pause will no longer fire a Sound.onStop signal, and the pause values are set before the onPause signal is dispatched (thanks @AnderbergE, fix #868) 2014-06-05 02:55:20 +01:00
photonstorm
369e2cc2d0 Sound.destroy(true) would call remove on the SoundManager, which in turn would throw a TypeError as it tried to remove the sound events twice (thanks @AnderbergE, fix #874) 2014-06-05 02:50:53 +01:00
photonstorm
1c9e23f535 Emitter.start has a new parameter: forceQuantity which will force the quantity of a flow of particles to be the given value (request #853)
Emitter.explode is a new short-cut for exploding a fixed quantity of particles at once.
Emitter.flow is a new short-cut for creating a flow of particles based on the given frequency.
2014-06-02 01:15:58 +01:00
photonstorm
12252944fa Time.add allows you to add an existing Phaser.Timer to the timer pool (request #864) 2014-06-02 00:54:42 +01:00
photonstorm
917c7491cd Canvas.create has deprecated the noCocoon parameter as it's no longer required. The parameter is still in the signature, but no longer used in the method. 2014-05-30 02:03:07 +01:00
photonstorm
6e8694d5f7 A Canvas style set from a game config object used an incorrect property (thanks @TatumCreative, fix #861) 2014-05-30 02:01:33 +01:00
photonstorm
edc1507b4e Resolved issue where Cocoon won't render a scene in Canvas mode if there is only one Sprite/Image on it. 2014-05-29 23:52:13 +01:00
photonstorm
eee1183a6a Forces use of a Canvas Renderer under CocoonJS automatically.
The SoundManager no longer requires a touch to unlock it, defaults to unlocked.
2014-05-29 23:17:18 +01:00
photonstorm
0c675f741f Wrapped all events that CocoonJS doesn't support in conditional checks to avoid Cocoon Warnings. 2014-05-29 22:25:40 +01:00
photonstorm
5a42a41608 Updated the JSON format. 2014-05-29 17:25:20 +01:00
photonstorm
5b5bdc80d9 Loader.pack will allow you to load in a new Phaser Asset Pack JSON file. An Asset Pack is a specially structured file that allows you to define all assets for your game in an external file. The file can be split into sections, allowing you to control loading a specific set of files from it. An example JSON file can be found in the resources folder and examples of use in the Phaser Examples repository.
Loader.totalQueuedPacks returns the number of Asset Packs in the queue.
Loader.totalLoadedPacks returns the number of Asset Packs already loaded.
2014-05-29 17:05:13 +01:00
photonstorm
066ab633a6 Loader.tilemap has renamed the mapURL parameter to url and mapData to data to keep it consistent with the other Loader methods.
Loader.physics has renamed the `dataURL` parameter to `url` and `jsonData` to `data` to keep it consistent with the other Loader methods.
2014-05-29 04:44:23 +01:00
photonstorm
af1508de8f BitmapData.addToWorld will create a new Phaser.Image object, assign the BitmapData to be its texture, add it to the world then return it.
BitmapData.copyPixels now accepts a Sprite, Image, BitmapData, HTMLImage or string as its source.
2014-05-29 03:30:21 +01:00
photonstorm
2219e6f1c9 Timer.ms would report the game time ms value if the Timer hadn't yet been started, instead of 0.
Timer.seconds would report the game time value if the Timer hadn't yet been started, instead of 0.
2014-05-28 23:27:26 +01:00
photonstorm
0c76e9aada Sprite animation data wasn't reset when going from a sprite sheet to a single frame in Sprite.loadTexture (thanks @lucbloom, fix #850) 2014-05-27 14:23:41 +01:00
photonstorm
5a0d5b4887 RetroFont now uses Phaser.scaleModes.NEAREST by default for its RenderTexture to preserve scaling. 2014-05-27 13:36:38 +01:00
photonstorm
cdde45a292 Phaser.RenderTexture incorrectly passed the scaleMode to Pixi.RenderTexture, causing the renderer to error. 2014-05-27 13:35:47 +01:00
photonstorm
9c35dfde0c ArcadePhysics.Body has a new boolean property enable. If false the body won't be checked for any collision or overlaps, or have its pre or post update methods called. Use this for easy toggling of physics bodies without having to destroy or re-create the Body object itself. 2014-05-27 11:22:58 +01:00
photonstorm
5b9bd96583 RetroFont.updateOffset allows you to modify the offsetX/Y values used by the font during rendering. 2014-05-27 05:23:34 +01:00
photonstorm
890d90af4d Keyboard.addCallbacks now has a new parameter for keypress event capture.
Keyboard.pressEvent stores the most recent DOM keypress event.
Keyboard.processKeyDown now runs the callback after all the objects have been created and/or updated.
Keyboard.processKeyUp now runs the callback after all the objects have been created and/or updated.
Phaser.Keyboard.lastChar will return the string value of the last key pressed.
Phaser.Keyboard.lastKey will return the most recently pressed Key object.
2014-05-27 04:26:37 +01:00
photonstorm
68f1bbd9a5 RetroFont charsPerRow paramters is now optional. If not given it will take the image width and divide it by the characterWidth value. 2014-05-27 04:26:23 +01:00
photonstorm
f007a77f3d Fixed Gamepad issue that incorrectly checked non-webkit prefix gamepads. 2014-05-26 22:02:53 +01:00
photonstorm
86c228d380 Group.destroy now removes any set filters (thanks @Jmaharman fix #844) 2014-05-26 20:13:00 +01:00
photonstorm
c5d9f12858 BitmapData.alphaMask has 2 new optional parameters: sourceRect and maskRect to give more fine-grained control over where the source and mask are drawn and their size
BitmapData.draw now has two optional parameters: width and height, to let you stretch the image being drawn if needed.
2014-05-24 03:58:00 +01:00
photonstorm
7846da7c90 BitmapData.alphaMask 'mask' parameter is now optional, if not given it will use itself as the mask.
BitmapData.alphaMask now calls BitmapData.update after running.
2014-05-24 03:17:58 +01:00
photonstorm
6e9c9c10b8 BitmapData.alphaMask can now also take a Phaser.Sprite, Phaser.Image or BitmapData object as a source type.
BitmapData.alphaMask has 4 new optional parameters: x, y, x2 and y2 to control exactly where the source and mask images are drawn.
2014-05-24 03:15:13 +01:00
photonstorm
f3ef3aed19 BitmapData.draw can now take a BitmapData object as a source type. 2014-05-24 02:43:59 +01:00
photonstorm
934f6a816c BitmapData.resize now properly updates the baseTexture and texture dimensions. 2014-05-24 02:02:49 +01:00
photonstorm
7b696dddfe BitmapData.extract has 4 new parameters: r2, g2, b2, a2 which let you re-color the extract pixels as they are drawn to the new BitmapData.
BitmapData.load will take a game object or string and resize the BitmapData to match it and then draw the pixels in.
2014-05-24 01:29:47 +01:00
photonstorm
bcddfc83c0 Sprite.alive property now explicitly defined on the Sprite prototype (thanks @lewster32, #841) 2014-05-21 21:48:29 +01:00
photonstorm
2a73652ed8 Preparing for 2.0.6 "Jornhill" development. 2014-05-20 10:56:45 +01:00
photonstorm
560a44f06e README fixes for 2.0.5 release. 2014-05-20 10:37:51 +01:00
photonstorm
43e079a53a Readme update. 2014-05-20 10:31:55 +01:00
photonstorm
8f07796af3 2.0.5 readme updates. 2014-05-20 10:03:02 +01:00
photonstorm
7b876d5fc4 ScaleManager.bounds is a Rectangle object that holds the exact size of the game canvas, taking DOM offset and game scale into account.
Pointer.withinGame is now accurate based on game scale and updated as the Pointer moves.
Stage.bounds is now updated if the game canvas offset changes position. Note that it gives the un-scaled game dimensions.
2014-05-19 18:49:59 +01:00
photonstorm
c9656e48de Group.hasProperty fixed to not use hasOwnProperty, but a series of in checks (thanks @mgiuffrida for the idea, #829) 2014-05-19 13:11:58 +01:00
photonstorm
1a7305b0ad New movement data added for a Pointer Locked mouse (Pointer.movementX/Y) (thanks @woutercommandeur, #831) 2014-05-19 11:51:25 +01:00
photonstorm
da75a22e82 Cache.checkKey added - allows you to pass in a Cache type and a key and return a boolean.
Cache.checkCanvasKey(key) - Check if a Canvas key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkTextureKey(key) - Check if a Texture key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkSoundKey(key) - Check if a Sound key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkTextKey(key) - Check if a Text key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkPhysicsKey(key) - Check if a Physics key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkTilemapKey(key) - Check if a Tilemap key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkBinaryKey(key) - Check if a Binary key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkBitmapDataKey(key) - Check if a BitmapData key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkBitmapFontKey(key) - Check if a BitmapFont key exists in the cache (thanks to @delta11 for the proposal)
Cache.checkJSONKey(key) - Check if a JSON key exists in the cache (thanks to @delta11 for the proposal)
2014-05-19 11:34:14 +01:00
photonstorm
cfadaf3e70 Tilemap.layer is a getter/setter to the current layer object (which can be changed with Tilemap.setLayer) 2014-05-15 22:30:32 +01:00
photonstorm
1d13855abb Tilemap.searchTileIndex allows you to search for the first tile matching the given index, with optional skip and reverse parameters. 2014-05-15 19:56:56 +01:00
photonstorm
2650e6c47e RetroFont.text would throw WebGL errors due to an issue with Pixi.RenderTexture. Fixed in Phaser and submitted code to Pixi.
RenderTexture.resize would throw WebGL errors due to an issue with Pixi.RenderTexture. Fixed in Phaser and submitted code to Pixi.
2014-05-15 15:32:59 +01:00
Richard Davey
21011c3d03 mouseout handler 2014-05-14 22:56:42 +01:00
photonstorm
5d8a11ae29 Input.addMoveCallback allows you to bind as many callbacks as you like to the DOM move events (Input.setMoveCallback is now flagged as deprecated)
Input.deleteMoveCallback will remove a previously set movement event callback.
2014-05-14 03:01:24 +01:00
photonstorm
b90bcc442c If an object was drag enabled with bringToTop, the onDragStop event wouldn't fire until the mouse was next moved (thanks @alpera, fix #813) 2014-05-14 02:42:55 +01:00
photonstorm
cc9a234c8c Color.getRGB would return incorrect color components if a color value without alpha was given, now works with both 0xRRGGBB and 0xAARRGGBB.
Color.getWebRGB now works regardless if you give an 0xRRGGBB or 0xAARRGGBB color value.
2014-05-14 02:09:44 +01:00
photonstorm
798d7a4fd1 Stage.backgroundColor now properly accepts hex #RRGGBB and color values 0xRRGGBB again (fix #785) 2014-05-14 01:59:21 +01:00