Commit graph

4992 commits

Author SHA1 Message Date
Richard Davey
64a44aab17 Added the following new constants: Phaser.TOP_LEFT, Phaser.TOP_CENTER, Phaser.TOP_RIGHT, Phaser.MIDDLE_LEFT, Phaser.MIDDLE_CENTER, Phaser.MIDDLE_RIGHT, Phaser.BOTTOM_LEFT, Phaser.BOTTOM_CENTER and Phaser.BOTTOM_RIGHT. 2016-06-15 23:37:48 +01:00
Richard Davey
32cf1f1a9c Group.createMultiple can now accept Arrays for both the key and frame arguments. This allows you to create multiple sprites using each key and/or frame in the arrays, which is a great and quick way to build diverse Groups. See the JSDocs for complete details and code examples. 2016-06-15 22:36:23 +01:00
gotenxds
91987eff56 Added some data to image object types. 2016-06-15 13:09:47 +03:00
Richard Davey
2aa2c67e7b Merge pull request #2563 from aaronklaassen/reign-rein
Fix reign/rein in getting started guide
2016-06-15 10:52:20 +01:00
Richard Davey
70be74cb36 Lots of work on Body.moveTo and Body.moveFrom. Now working nicely. 2016-06-15 04:12:47 +01:00
Aaron Klaassen
aacb3436a4 Fix reign/rein typo. 2016-06-14 21:00:06 -05:00
Richard Davey
b5cc01132c Body.move tests. 2016-06-14 23:45:00 +01:00
photonstorm
834a8df99d Fixed concat grunt task so that the Weapon plugin is included. 2016-06-14 15:45:20 +01:00
photonstorm
bc00c900e9 BitmapData.smoothProperty is a new property that holds the string based prefix needed to set image scaling on the BitmapData context.
BitmapData.copyTransform allows you to draw a Game Object to the BitmapData, using its `worldTransform` property to control the location, scaling and rotation of the object. You can optionally provide

BitmapData.drawGroup now uses the new `copyTransform` method, to provide for far more accurate results. Previously nested Game Objects wouldn't render correctly, nor would Sprites added via `addChild` to another Sprite. BitmapText objects also rendered without rotation taken into account, and the Sprites smoothing property was ignored. All of these things are now covered by the new drawGroup method, which also handles full deep iteration down the display list.
2016-06-14 15:29:56 +01:00
photonstorm
189cbf4132 Added exists property. 2016-06-14 15:29:45 +01:00
photonstorm
6383f6b1fb Updated docs. 2016-06-14 15:29:38 +01:00
photonstorm
7817d47a25 Updated Cache docs. 2016-06-14 12:18:32 +01:00
photonstorm
ad3641830d Phaser.Matrix if passed a 0 value would consider it falsy, and replace it with the default by mistake. It now checks if the arguments are undefined or null and only then sets the defaults (thanks mmcs) 2016-06-14 12:18:23 +01:00
Richard Davey
7108bc3de3 Merge pull request #2552 from drhayes/dev
Distinguish between Arrays and Objects when cloning in Cache.getJSON.
2016-06-14 11:49:02 +01:00
Richard Davey
c484da3e16 Merge pull request #2561 from danzel/dev
Add Pointer.pointerMode
2016-06-14 11:45:27 +01:00
Dave Leaver
4dde32d746 Add Pointer.pointerMode 2016-06-14 18:02:11 +12:00
photonstorm
fb3f7721cb Working through updating BitmapData.copy to use the source matrix instead, so it retains the correct draw sequence order. 2016-06-13 17:01:33 +01:00
photonstorm
1a3b06a9f4 The DisplayObject.worldRotation value didn't sign the wt.c value correctly, meaning the rotation would be wrong.
The `DisplayObject.worldScale` value didn't multiply the local objects scale into the calculation, meaning the value wasn't a true representation of the objects world scale.
2016-06-13 17:01:03 +01:00
Pete Baron
6848c90257 Added remaining task summary. 2016-06-14 01:20:43 +12:00
Pete Baron
04980c8096 Remove hack to force WEBGL mode for testing. 2016-06-14 01:02:02 +12:00
Pete Baron
11c5300591 Remove dubious use of tile.index to reference the tilesets list (it seems unlikely that there would ever be a tilesets value for every tile, and a huge waste of memory if it was ever done that way).
TODO: look into putting the tileset index (or a tileset reference) into each Tile structure when building them to avoid resolveTilesets entirely too.
2016-06-14 00:43:46 +12:00
Pete Baron
7533005a62 Fix buffer size bug. 2016-06-14 00:00:18 +12:00
Pete Baron
b406d10d94 Comments, and removed reinitialisation of the glBatch list. 2016-06-13 18:40:51 +12:00
Pete Baron
310b151924 Removed pixiTest flag, using renderType instead. 2016-06-13 18:39:52 +12:00
Pete Baron
a648026fa4 Progress update. 2016-06-13 18:39:16 +12:00
Pete Baron
c7476a6583 Fixed bug where scroll was effectively applied twice. 2016-06-13 18:38:55 +12:00
Pete Baron
446eab60af Progress update. 2016-06-13 17:47:25 +12:00
Pete Baron
05efcfe36e Modified my PIXI.Tilemap class to accept the glBatch list of tile source and destination coordinates, convert them into a GL TRIANGLE_STRIP data buffer, then draw them as a single batch WebGL draw. 2016-06-13 17:28:35 +12:00
Pete Baron
a8405bd066 add comment 2016-06-13 17:26:33 +12:00
Pete Baron
57a6245f25 Made a copy of Phaser.TilemapLayer which instead extends PIXI.Tilemap, then added functions to build a batch list of tile source and destination coordinates (instead of drawing them directly onto a Canvas). This maintains all the existing Phaser functionality in regards to tile map decoding and interpretation, and also provides maximum performance from the PIXI component by using a TRIANGLE_STRIP to render everything as a single batch job. 2016-06-13 17:25:50 +12:00
Pete Baron
94d49f1196 Add GL variant of the Tileset.draw function for new approach to WebGL tile drawing (utilising most of the existing Phaser code unchanged) 2016-06-13 17:13:13 +12:00
David Hayes
346aed2866 Distinguish between Arrays and Objects when cloning in Cache.getJSON.
Fixes #2551.
2016-06-10 10:33:33 -05:00
photonstorm
0880380ea9 Phaser 2.4.9 RC4. 2016-06-10 16:22:54 +01:00
Richard Davey
1daf897b23 Small styling fixes. 2016-06-09 23:27:19 +01:00
Richard Davey
5415d9b603 Stage and Group postUpdate methods iterate the same way now. 2016-06-09 23:14:24 +01:00
Richard Davey
cd8bb5a216 Removed keyCode modifier (#2542) 2016-06-09 22:03:09 +01:00
Richard Davey
57642afc24 Fixed keyboard issue. 2016-06-09 20:55:21 +01:00
photonstorm
28c1a26780 Phaser 2.4.9 RC3. 2016-06-09 17:13:31 +01:00
photonstorm
88f47e2497 Keyboard now uses a new internal method getKeyCode to normalize the key code value based on browser support. It first checks for event.key, then event.keyIdentifier and finally event.keyCode (thanks @SVasilev #2542) 2016-06-09 16:37:32 +01:00
photonstorm
2ac594ca03 TypeScript defs update. 2016-06-09 16:29:09 +01:00
photonstorm
a65f9c7e4b Group.onChildInputDown is a new Signal that you can listen to. It will be dispatched whenever any immediate child of the Group emits an onInputDown signal itself. This allows you to listen for a Signal from the Group, rather than every Sprite within it.
Group.onChildInputUp is a new Signal that you can listen to. It will be dispatched whenever any immediate child of the Group emits an `onInputUp` signal itself. This allows you to listen for a Signal from the Group, rather than every Sprite within it.

Group.onChildInputOver is a new Signal that you can listen to. It will be dispatched whenever any immediate child of the Group emits an `onInputOver` signal itself. This allows you to listen for a Signal from the Group, rather than every Sprite within it.

Group.onChildInputOut is a new Signal that you can listen to. It will be dispatched whenever any immediate child of the Group emits an `onInputOut` signal itself. This allows you to listen for a Signal from the Group, rather than every Sprite within it.
2016-06-09 16:19:11 +01:00
photonstorm
28331c4f7f Comment fix. 2016-06-09 15:37:03 +01:00
photonstorm
458a67251d Fixed input property check. 2016-06-09 15:09:20 +01:00
photonstorm
90e1460320 Added new Debug.displayList function. 2016-06-09 14:58:58 +01:00
photonstorm
99aeae5e4d Docs update. 2016-06-09 14:58:41 +01:00
photonstorm
24f4abe760 Group.add has a new optional argument index which controls the index within the group to insert the child to. Where 0 is the bottom of the Group.
Group.addAt has been refactored to be a simple call to `Group.add`, removing lots of duplicate code in the process.

Group.create has a new optional argument `index` which controls the index within the group to insert the child to. Where 0 is the bottom of the Group. It also now makes proper use of `Group.add`, cutting down on more duplicate code.

Group.createMultiple now returns an Array containing references to all of the children that the method created.
2016-06-09 14:58:35 +01:00
photonstorm
c64749fef2 Added missing properties. 2016-06-09 14:54:39 +01:00
photonstorm
92d3a5efa8 Adds a callback that is fired every time 'Pointer.processInteractiveObjects' is called.
The purpose of `processInteractiveObjects` is to work out which Game Object the Pointer is going to
interact with. It works by polling all of the valid game objects, and then slowly discounting those
 that don't meet the criteria (i.e. they aren't under the Pointer, are disabled, invisible, etc).

Eventually a short-list of 'candidates' is created. These are all of the Game Objects which are valid
for input and overlap with the Pointer. If you need fine-grained control over which of the items is
selected then you can use this callback to do so.

The callback will be sent 3 parameters:

1) A reference to the Phaser.Pointer object that is processing the Items.
2) An array containing all potential interactive candidates. This is an array of `InputHandler` objects, not Sprites.
3) The current 'favorite' candidate, based on its priorityID and position in the display list.

Your callback MUST return one of the candidates sent to it.
2016-06-09 14:49:10 +01:00
photonstorm
7c2d1d4ab8 Pointer.interactiveCandidates is a new Array that is erased and re-populated every time this Pointer is updated. It contains references to all of the Game Objects that were considered as being valid for processing by this Pointer, during the most recent update. To be valid they must have suitable a priorityID, be Input enabled, be visible and actually have the Pointer over them. You can check the contents of this array in events such as onInputDown, but beware: it is reset every update.
Pointer.swapTarget allows you to change the `Pointer.targetObject` object to be the one provided. This allows you to have fine-grained control over which object the Pointer is targeting.
2016-06-09 14:36:15 +01:00
photonstorm
fa43bec19f PIXI.DisplayObjectContainer.ignoreChildInput is a new property. If true then the children will _not_ be considered as valid for Input events. Because this has been applied to DisplayObjectContainer it means it's available in Group, Sprite and any other display level object. Using this boolean you can disable input events for all children in an entire Group, without having to iterate anything or deep-set flags.
InputHandler._pointerOverHandler and _pointerOutHandler have new arguments `silent` - if `true` then they will not dispatch any Signals from the parent Sprite.
2016-06-09 14:32:56 +01:00