Commit graph

5414 commits

Author SHA1 Message Date
photonstorm
19dce62734 Arcade Physics has had a new world argument added to the following functions: distanceBetween, distanceToXY, distanceToPointer, angleBetween, angleToXY and angleToPointer. The argument (which is false by default), when enabled will calculate the angles or distances based on the Game Objects world property, instead of its x and y properties. This allows it to work for objects that are placed in offset Groups, or are children of other display objects (thanks @Skeptron for the thread #2463) 2016-05-16 13:31:57 +01:00
photonstorm
a26bd55811 TS defs fix #2475 2016-05-16 13:03:48 +01:00
Richard Davey
6eca457877 Merge pull request #2476 from staff0rd/generate_texture
fix generateTexture return type
2016-05-16 12:56:27 +01:00
photonstorm
4fd2524c61 Text.setStyle has a new argument update which will optionally automatically call updateText after setting the new style (thanks @staff0rd #2478) 2016-05-16 12:55:27 +01:00
Pete Baron
55870bce8a Results of retesting for all tilemap examples. Most work with many having an 'out by one' tile issue (I've requested help from Rich on this). I'll investigate the other failures now. 2016-05-13 15:08:53 +12:00
Pete Baron
90dcdbfa98 Log file of progress on Tilemap GL work. 2016-05-13 14:41:24 +12:00
Pete Baron
5c6ad9cbcb Fix double subtraction error. 2016-05-13 14:34:24 +12:00
Pete Baron
e396c266b8 Use the correctly scaled scrollX, scrollY parameters for the scroll offsets.
This makes the layers in "blank tilemap" example work properly (you'll need to click the 3rd tile in the palette before drawing becomes visible - that's next up)
2016-05-13 14:13:51 +12:00
Pete Baron
5be5ddba25 Protect against zero and negative indexes (-1 is used in e.g. "blank tilemap" example). 2016-05-13 14:06:58 +12:00
Pete Baron
49b3d1a57a Temporary modification to force webgl renderer without needing to edit all the example files. 2016-05-13 14:06:08 +12:00
Pete Baron
e0008793bd Prepare Phaser.Tilemap for testing other examples/tilemaps with the TilemapLayerGL code.
Ensure that TilemapLayerGL is treated as a valid layer the same as TilemapLayer.

TODO: I've hardwired the PIXI TilemapLayerGL test flag (pixiTest) to be 'on' unless otherwise specified... need to turn this off before final commits!
2016-05-13 12:24:55 +12:00
Pete Baron
a98d0e8e70 First pass of 'clean-up': correcting comments, removing unused code 2016-05-13 12:06:18 +12:00
Pete Baron
4cfcb3b7bd Implemented _renderMode switch and _renderVisibleTiles functionality. This speeds up the sci-fly demo hugely. 2016-05-13 11:37:33 +12:00
Pete Baron
0855e59972 Added _renderMode to switch between full-map redrawing and visible screen redrawing modes. 2016-05-13 11:36:12 +12:00
stafford
e6b9ca4e22 fix generateTexture return type 2016-05-12 15:30:33 +10:00
photonstorm
f34b567295 BitmapData.copy, and by extension any method that uses it, including BitmapData.draw, drawGroup and drawFull, now all support drawing RenderTexture objects. These can either be passed directly, or be the textures of Sprites, such as from a call to generateTexture. 2016-05-12 03:48:14 +01:00
photonstorm
94832677b9 Docs update. 2016-05-11 16:39:39 +01:00
photonstorm
85d5d9715d Removed, this has gone to its own branch. 2016-05-11 16:38:56 +01:00
photonstorm
1d18c70371 BitmapData.drawGroupProxy is now capable of iterating through Sprites that have children, and also now uses the world positions for drawing instead. 2016-05-11 16:38:42 +01:00
photonstorm
74af2079b6 Swap to use worldScale instead of worldTransform. 2016-05-11 16:37:31 +01:00
photonstorm
621673b9ca Revert worldScale setter. 2016-05-11 16:37:21 +01:00
photonstorm
815907184a Typo fix. 2016-05-11 16:37:01 +01:00
photonstorm
9649f714bb InputHandler.checkPointerDown and checkPointerOver will now test the worldTransform scale property of a Sprite. If zero it will fast return, where-as before it would incorrectly report an up event (thanks @jaapaurelio #2466) 2016-05-11 12:25:35 +01:00
photonstorm
368913fd98 Removed WebGL Tilemap renderer, has moved to its own branch to be part of 2.5.0. 2016-05-11 11:27:36 +01:00
photonstorm
a2ba13e33f Docs update. 2016-05-11 11:27:36 +01:00
photonstorm
16203a378a PIXI.defaultRenderer is now set to null in Game.destroy, allowing it to be reset if a new Game instance is created on the same page (thanks @xtforgame ##2474) 2016-05-11 11:27:36 +01:00
Richard Davey
fd8f6117e2 Merge pull request #2469 from mortonfox/patch-1
Update link to CONTRIBUTING.md
2016-05-11 10:04:14 +01:00
Casey Leonard
9ede913609 gamepad bugs in Chrome
fixes issues with being unable to connect a gamepad in Chrome and losing
the gamepad when focus is lost to the game
2016-05-07 19:07:16 -04:00
Morton Fox
e125696ccd Update link to CONTRIBUTING.md 2016-05-07 00:43:13 -04:00
Pete Baron
5e97f10c86 Remove un-needed mixin components leaving only FixedToCamera (not sure about this one). Move this.fixedToCamera after the Core.init call which creates the underlying core components required. Add temporary instant return from shiftCanvas in case that was being called and contributing to the slow-down (probably not). 2016-05-05 17:00:22 +12:00
Pete Baron
ef4143136e Use this.x, this.y as scrolling offsets when rendering each tile. 2016-05-05 16:57:55 +12:00
Pete Baron
69abe492cc Modified Phaser.Tilemap and PIXI.Tilemap to support the new Phaser.TilemapLayerGL objects.
The PIXI file has a reverse dependency on Phaser for it's 'layer' parameter which contains a Phaser.Tilemap (which holds the map data).  The other changes adapt it to the new data source (previously this expected a raw JSON object encoded like the Mario.json map is).

The Phaser file now keeps a reference to the data parsed from the original map, and adds a branch in createLayer to build a TilemapLayerGL instead of a TilemapLayer.
2016-05-05 15:58:03 +12:00
Pete Baron
671fe4ef5b Add new Phaser.TilemapLayerGL class to the build. 2016-05-05 15:53:04 +12:00
Pete Baron
ad04676980 New class: duplicate of Phaser.TilemapLayer modified to access the new PIXI.Tilemap WebGL based tile renderer.
This is just the first test which actually produces some visible output (the map is drawn for the "sci fly" demo example, if you adjust line 27 of that source file to: layer = map.createLayer(0, undefined, undefined, undefined, true);
The new terminal "true" parameter instructs Phaser.Tilemap.createLayer to create a TilemapLayerGL object instead of the usual Phaser.TilemapLayer.
2016-05-05 15:52:26 +12:00
photonstorm
45118e7a60 Docs fix. 2016-05-04 23:34:15 +01:00
Pete Baron
eb77949f63 Strip down PIXI.Tilemap to remove all unused code.
Add very simple tilemap render function to draw every layer, every tile, for the tiles provided.
Link to the TilemapShader and get the whole thing working.
2016-05-05 10:29:51 +12:00
Pete Baron
9deb07c3aa Modify this shader to draw a simple textured rectangle using a two-tri strip, extremely quickly due to simplicity. 2016-05-05 10:28:12 +12:00
photonstorm
1adece490a Docs update. 2016-05-04 02:02:13 +01:00
photonstorm
7afe087c3d Docs fix. 2016-04-29 17:46:44 +01:00
photonstorm
2e1c858196 Added Create. 2016-04-29 01:41:15 +01:00
photonstorm
7332dd8028 Custom WebGL Tilemap renderer POC displaying textures. It's a start. 2016-04-28 00:18:09 +01:00
photonstorm
b008fc7216 Readme update. 2016-04-28 00:18:08 +01:00
Richard Davey
88977e4609 Merge pull request #2444 from staff0rd/typescript_SaveCPU_Plugin
added type definintions for SaveCPU plugin
2016-04-28 00:05:31 +01:00
Richard Davey
d16ef28ae6 Merge pull request #2452 from osev7/patch-1
typescript defs: Allow game.physics.arcade.collide(group) for collisions within group
2016-04-27 23:56:43 +01:00
photonstorm
16378713b4 JSDocs update (#249) 2016-04-27 12:57:41 +01:00
photonstorm
d55b0c9e51 Tilemap update. 2016-04-27 03:38:07 +01:00
photonstorm
b10c8858c3 Tilemap shader WIP. 2016-04-27 03:02:13 +01:00
osev7
65f7f06849 Allow game.physics.arcade.collide(group) for collisions within group 2016-04-26 09:41:13 -04:00
photonstorm
f494c867c7 Fixed an issue in the Arcade Physics overlap method where it would only detect overlaps up to the max bias threshold and no further (thanks @rgk #2441)
The Arcade Physics overlap method would return false if two bodies were overlapping but neither had any velocity (i.e. they were embedded into each other)
2016-04-25 11:38:51 +01:00
photonstorm
620b95e510 Updated docs and TS defs re: #2443 2016-04-23 04:36:47 +01:00