Commit graph

5331 commits

Author SHA1 Message Date
Pete Baron
1b7eaadd06 First (nearly) working batch drawing test. Instead of pushing rectangles as pairs of triangles individually, this version creates a vertex buffer object for all visible tile rectangles, with degenerate triangles separating each one from the next. The drawing is done by a single call to gl.drawArrays.
Bizarrely, this version still chokes in Firefox, implying that the previous demo's horrible performance was not down to the GPU blocking as the rectangles are sent to it.

The test is not fully working because it does not scroll the drawing position. So instead of the map moving when you hit a scroll boundary, it simply stops drawing the top or left edges as the scroll region moves away from the visible window.  It's an easy fix, but I think I'll leave it until I find out exactly why Firefox still chokes on this demo.

Progress text file updated with latest experiments and progress today.
2016-05-23 17:48:54 +12:00
monagames
2fee58fefc Fixed typescript definitions for PIXI ColorMatrixFilter 2016-05-22 09:58:10 +02:00
monagames
12397377ab Fixes for typescript declarations with system.js 2016-05-21 20:22:40 +02:00
Thanabodee Charoenpiriyakij
1387aaa055 typescript/pixi.d.ts: Add padding to Graphics.generateTexture 2016-05-21 14:12:37 +07:00
photonstorm
d1234d1685 Preparing for 2.5.0 dev. 2016-05-19 13:45:51 +01:00
photonstorm
9f28d0659d Phaser 2.4.8 release. 2016-05-19 12:36:51 +01:00
Richard Davey
0bf2f985af Merge pull request #2483 from zeterain/patch-6
Update Documentation in Game.js
2016-05-19 11:59:48 +01:00
Upperfoot
4a3e8f2b4a Take into consideration Tilemap position into collision 2016-05-19 11:06:49 +01:00
Upperfoot
55700e4fec Take into account position of tilemap in collision 2016-05-19 08:47:31 +01:00
zeterain
cd188ed0ab Update Documentation in Game.js
Updated the documentation in Game.js to indicate that the renderType property could be set to Phaser.HEADLESS.
2016-05-18 10:56:44 -06:00
photonstorm
a6a2c61240 Sprites that had a tint on them, that then had their frame changed via either Sprite.frame or Sprite.frameName wouldn't re-tint the new frame, and would become stuck on the old frame in Canvas mode (thaks @spayton #2453) 2016-05-17 21:04:40 +01:00
photonstorm
d161a7f6bc Sounds played using the Audio tag, set to loop, would get caught in an endless pause-play loop cycle (thanks @rroylance #2473) 2016-05-17 16:43:11 +01:00
photonstorm
7018ca2132 Position in Body.reset #2470 2016-05-16 15:20:44 +01:00
photonstorm
54683b7fb2 Sounds played using the Audio tag, that were paused and then resumed again (either directly in code, or via a game pause event) would not resume from the point at which they paused (thanks @rroylance #2473) 2016-05-16 15:16:19 +01:00
photonstorm
02e8b1ae0a If you set Game.renderType to Phaser.HEADLESS it will no longer render the output to the canvas. The canvas is still created (although not added to the DOM), as it's required internally, but no rendering now takes place on it (thanks @ForgeableSum #2464) 2016-05-16 14:53:11 +01:00
photonstorm
ac89d1aec7 Arcade Physics Body has a new property worldBounce. This controls the elasticity of the Body specifically when colliding with the World bounds. By default this property is null, in which case Body.bounce is used instead. Set this property to a Phaser.Point object in order to enable a World bounds specific bounce value (thanks @VitaZheltyakov #2465) 2016-05-16 13:53:12 +01:00
photonstorm
f9994fac75 Fixed a bug in Arcade Physics Body.preUpdate which would incorrectly apply the position of an offset Body (one which has had Body.setSize used on it) when combined with a Sprite with a non-zero anchor (thanks @SBCGames #2470) 2016-05-16 13:39:46 +01:00
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