Commit graph

3786 commits

Author SHA1 Message Date
photonstorm
a4963adec3 jsdoc clarification. 2015-04-21 15:54:44 +01:00
photonstorm
8fb5a89e1f Added video alias. 2015-04-21 05:11:31 +01:00
photonstorm
8981e9603e Removed Frame.uuid and updating TileSprite to work with animated sprites. 2015-04-21 05:11:19 +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
e6ab4884a6 Set usingWebAudio if using it :) 2015-04-21 02:07:47 +01:00
Clark Stevenson
aa4ebab29d Update PIXI.d.ts generateTexture
Should fix #1719 ?
2015-04-20 16:27:35 +01:00
photonstorm
12f8454d62 close #1755 2015-04-19 01:35:15 +01:00
photonstorm
a5c14befa7 Formatting. 2015-04-17 19:56:14 +01:00
photonstorm
21de1e7c09 Added delayed load event handling back in. 2015-04-17 19:55:53 +01:00
photonstorm
97bc582f8d Added VideoTexture support back in and fixed various load related issues. 2015-04-17 19:55:30 +01:00
photonstorm
a2eaccabed Added EventTarget and VideoTexture back into Pixi. 2015-04-17 19:55:08 +01:00
photonstorm
b196e4f17e Enabled PIXI.VideoTexture support. 2015-04-17 17:36:20 +01:00
photonstorm
48f04f1ec5 Fixed hasLoaded filter mappings. 2015-04-17 17:36:05 +01:00
photonstorm
714580f9a9 Manual fix #1752 2015-04-17 17:35:52 +01:00
photonstorm
8476a0b87f One ! too many #1746 2015-04-17 14:26:01 +01:00
photonstorm
2bf11ab5f6 Version number fix. 2015-04-17 03:54:01 +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
8144c4910e jshint fixes. 2015-04-17 03:23:40 +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
3a61fa35f0 RenderTexture.render now takes a Matrix as its second parameter, not a Point object. This brings it in line with Pixi and allows you to perform much more complex transformations on the object being rendered. If you need to replicate the old behavior please use RenderTexture.renderXY(sprite, point.x, point.y) instead.
RenderTexture.render and `renderXY` would ignore the Sprites rotation or scale. The full Sprite transform is now used correctly when the Sprite is drawn to the texture. If you wish to replicate the old behavior please use `RenderTexture.renderRawXY` instead.

RenderTexture.matrix has been removed as it's no longer used.

Fixed bug in Pixi where RenderTexture.render would ignore the given matrix.

Fixed a bug in Pixi where drawing a Sprite to a RenderTexture would reset the Sprites transform to an identity Matrix.
2015-04-17 03:22:07 +01:00
photonstorm
cdfc4ff45b Pixi.Sprite.renderCanvas and renderWebGL now has a new optional matrix parameter. You can use this to render the Sprite with an alternative transform matrix without actually adjusting the Sprite matrix at all. 2015-04-17 03:20:44 +01:00
photonstorm
1d8f88173d Phaser.Matrix.clone allows you to clone the Matrix to a new object, or copy its values into the given Matrix.
Phaser.Matrix.copyFrom and copyTo allow you to copy Matrix values from and to other Matrix  objects.

Phaser.Matrix.setTo allows you to set all properties of a Matrix in a single call.

The Phaser.Matrix constructor now allows you to optionally set all Matrix properties on instantiation.
2015-04-17 03:19:28 +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
333663731d Added the missing preRender function to the Phaser.State class template. 2015-04-15 01:37:18 +01:00
photonstorm
f2f8dcd061 Phaser.StateManager no longer calls preRender unless the State create method has finished. If the State doesn't have a create method then preRender runs immediately.
Phaser.StateManager.created is a new read-only boolean that tells you if the State has finished running its `create` method. If it doesn't have one it's always true.
2015-04-15 01:36:50 +01:00
photonstorm
b0e1b8facb jsdoc fixes. 2015-04-15 01:36:25 +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
7b011fe0d3 Fix #1742 2015-04-14 09:31:04 +01:00
Richard Davey
2a2b309e9a Merge pull request #1741 from ggarek/dev
fix(typescript): fix Matrix.fromArray definition
2015-04-13 23:25:29 +01:00
photonstorm
234497ddea Removed Creature libs from jshint. 2015-04-13 23:19:05 +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
1f4e54eec9 Removed duplicate methods from PIXI.Text such as wordWrap and updateText as Phaser overrides them, so it was wasting bytes. 2015-04-13 21:54:14 +01:00
Igor Ovsiannikov
207cea6e14 fix(typescript): fix Matrix.fromArray definition
Added explicity `void` return type for Matrix.fromArray.
Reason: it has similar function type in pixi.d.ts, and it caused
troubles when using typescript compiler with `--noImplicitAny` flag.
2015-04-13 23:11:43 +03: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
a7db0e2c70 Group.hash is an array (previously available as Group._hash, but protected) into which you can add any of its children via Group.addToHash and Group.removeFromHash. Only children of the Group can be added to and removed from the hash. The hash is used automatically by Arcade Physics in order to perform non z-index based destructive sorting. However if you don't use Arcade Physics, or it isn't a physics enabled Group, then you can use the hash to perform your own sorting and filtering of Group children without touching their z-index (and therefore display draw order).
Group.physicsSortDirection is a new property allowing you to set a custom sort direction for Arcade Physics Sprites within the Group hash. Previously Arcade Physics used one single sort direction (defined on `Phaser.Physics.Arcade.sortDirection`) but this change allows you to specifically control how each and every Group is sorted, so you can now combine tall and wide Groups with narrow and thin in a single system.
2015-04-13 16:30:02 +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
35bfe5fb2a Body.destroy now automatically calls Group.removeFromHash. 2015-04-13 16:27:43 +01:00
photonstorm
412338478c Added in all hooks required for MatterJS Physics (coming soon!) 2015-04-13 16:16: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
Richard Davey
78e7be5c96 Merge pull request #1738 from mandarinx/patch-1
Looking up object layers based on id, uid or name
2015-04-13 12:35:24 +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
0aaa77a84d Strict check. 2015-04-13 11:58:45 +01:00