Commit graph

3647 commits

Author SHA1 Message Date
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
photonstorm
0ccb3515d5 Removed dirty flag. 2015-04-13 11:58:44 +01:00
photonstorm
8bca406889 Console update. 2015-04-13 11:58:44 +01:00
Richard Davey
0b3fc61ba7 Merge pull request #1723 from dgoemans/dev
Fix for Phaser with requirejs
2015-04-13 11:29:58 +01:00
Richard Davey
b1f294e445 Merge pull request #1722 from GGAlanSmithee/dev
Minor change to Tilemap class
2015-04-13 11:24:29 +01:00
Richard Davey
daea4e8087 Merge pull request #1728 from cuixiping/dev
Fix bug of Color.webToColor and Color.updateColor
2015-04-13 11:23:44 +01:00
Richard Davey
87ea5a2b78 Merge pull request #1730 from clark-stevenson/patch-1
Update phaser.d.ts
2015-04-13 11:21:44 +01:00
Richard Davey
e6caa750b5 Merge pull request #1736 from englercj/dev
Check for existence of sprite on body destroy
2015-04-13 11:20:05 +01:00
Chad Engler
b89cdd5a0c check for existence of sprite on body destroy 2015-04-12 17:30:54 -07:00
Thomas Viktil
b406a61262 Looking up object layers based on id, uid or name
The description of the method stated that you could pass a string to look up an object layer based on its name, but the original code only looked for a gui property, regardless of type.

I'm using Tiled 0.11.0 on OSX, and my exported json-file doesn't contain a gui property on the object layers. Here's a snippet of my file:
```
{
    "layers":[
        {
         "draworder":"topdown",
         "height":0,
         "name":"Objects",
         "objects":[
                {
                 "height":48,
                 "id":1,
                 "name":"pier",
                 "properties":
                    {

                    },
                 "rotation":0,
                 "type":"",
                 "visible":true,
                 "width":64,
                 "x":208,
                 "y":240
                }],
         "opacity":1,
         "properties":
            {
             "type":"pier"
            },
         "type":"objectgroup",
         "visible":true,
         "width":0,
         "x":0,
         "y":0
        }]
    }]
}
```

The property in my file is called id and not uid. This might be due to changes in one of the later releases of Tiled. I kept the check for uid to avoid possibly breaking compatibility with older versions of Tiled.

I also added scaling of the sprite.

Feel free to make formatting changes, or rewrite the function to better fit the programming style of Phaser.
2015-04-11 22:16:17 +02:00
Clark Stevenson
a0a8f34c7b Update phaser.d.ts
Fixes #1729
2015-04-10 12:53:20 +01:00
cuixiping
d0ec5e4060 Fix bug of Color.webToColor and Color.updateColor
Color.webToColor and Color.updateColor should update out.color and out.color32 property.
2015-04-09 12:14:20 +08:00
Clark Stevenson
c2c3306449 Merge branch 'dev' of https://github.com/photonstorm/phaser into dev 2015-04-08 19:10:57 +01:00
photonstorm
482806b4b1 Added guards around context.getImageData calls in BitmapData, Text and Canvas Tinting classes to avoid crashing restricted browsers like Epic Browser. Please understand that several Phaser features won't work correctly with this browser (thanks @Erik3000 #1714) 2015-04-08 19:09:48 +01:00
Ian Suda
dc5dd8276f Fix some errors in the definitions files for Phaser.Group 2015-04-08 19:09:38 +01:00
hardalias
7ec3d01b2b Fixes neverending tween when duration set to zero
* Passing a value of zero as the value of duration causes the
 calculations performed in Tween#update to divide by zero when
 calculating the next step for the tween. This causes the tweened
 property value to be set to NaN having undesireable results and
 also, causes the tween to never end since the ending criteria are
 never met.
2015-04-08 19:09:29 +01:00
photonstorm
dbd696ed33 Sprite was missing the Health and InCamera components. 2015-04-08 19:09:20 +01:00
photonstorm
bd9380c4c9 The LoadTexture component has had a redundant dirty call removed from it.
TileSprites were missing a `physicsType` property, causing them to not collide with anything (thanks @numbofathma #1702)
2015-04-08 19:09:10 +01:00
photonstorm
3d704baec4 Trying out removal of dirty flag. 2015-04-08 19:09:01 +01:00
photonstorm
0e6670a06f jsdoc fixes. 2015-04-08 19:08:51 +01:00
photonstorm
ccbc8ab08b Added missing resumed method to Phaser.State class template. 2015-04-08 19:08:42 +01:00
photonstorm
5a6117bf79 Preparing for 2.3.1 development. 2015-04-08 19:08:33 +01:00
David Goemans
73bace335a Built a fix into p2.js v0.6.1 for using requirejs with phaser. This has also been put as a pull request to p2.js 2015-04-06 12:43:03 +02:00
Alan Smithee
d2e3a69525 Adds nonNull parameter to Tilemap.getTileWorldXY
Since Tilemap.getTile lets you specify wether to return null
or an empty tile when index is -1, the WorldXY equivalent
should offer the same possibility for a more unified interface.
2015-04-06 10:08:37 +00:00
Alan Smithee
c2bf1ef550 Merge branch 'dev' of github.com:GGAlanSmithee/phaser into dev 2015-04-06 10:03:49 +00:00
cuixiping
a4c4c643f4 Merge pull request #1 from photonstorm/dev
update to official
2015-04-04 16:09:13 +08:00
photonstorm
36c064511c Added guards around context.getImageData calls in BitmapData, Text and Canvas Tinting classes to avoid crashing restricted browsers like Epic Browser. Please understand that several Phaser features won't work correctly with this browser (thanks @Erik3000 #1714) 2015-04-02 14:47:44 +01:00
Richard Davey
ef5c0d89de Merge pull request #1711 from AyogoHealth/definitions-fix
Fix some errors in the definitions files for Phaser.Group
2015-04-02 01:21:02 +01:00
Ian Suda
0d4bce2101 Fix some errors in the definitions files for Phaser.Group 2015-04-01 15:35:08 -07:00
Richard Davey
76e1c57570 Merge pull request #1710 from hardalias/bugfix/tween_dividebyzero
Fixes neverending tween when duration set to zero (caused by division with zero)
2015-04-01 16:16:18 +01:00
hardalias
4bd7a40e84 Fixes neverending tween when duration set to zero
* Passing a value of zero as the value of duration causes the
 calculations performed in Tween#update to divide by zero when
 calculating the next step for the tween. This causes the tweened
 property value to be set to NaN having undesireable results and
 also, causes the tween to never end since the ending criteria are
 never met.
2015-04-01 15:01:05 +03:00
photonstorm
645723f939 Sprite was missing the Health and InCamera components. 2015-03-30 13:51:47 +01:00
photonstorm
5fb1130175 The LoadTexture component has had a redundant dirty call removed from it.
TileSprites were missing a `physicsType` property, causing them to not collide with anything (thanks @numbofathma #1702)
2015-03-28 00:56:02 +00:00
photonstorm
57474c0d44 Trying out removal of dirty flag. 2015-03-27 10:47:45 +00:00
photonstorm
67039df214 jsdoc fixes. 2015-03-27 10:47:25 +00:00
photonstorm
49be59b0c9 Added missing resumed method to Phaser.State class template. 2015-03-26 10:54:32 +00:00
photonstorm
413c81e034 Preparing for 2.3.1 development. 2015-03-26 04:01:37 +00:00
photonstorm
63c9d2e880 Phaser 2.3.0 Release 2015-03-26 03:27:34 +00:00
photonstorm
f23ab1f3a9 TypeScript defs with comments update. 2015-03-26 02:59:11 +00:00
photonstorm
d7c0a907f9 Small grunt fix. 2015-03-26 02:58:47 +00:00