Richard Davey
91e7b2ca9c
Updated properties.
2016-07-22 00:30:55 +01:00
Pete Baron
8c6fec0e97
Apply "half pixel correction" to the source coordinates for tiles when drawing with WebGL.
2016-07-22 11:30:06 +12:00
Richard Davey
8832680aa0
Exposed 'width' and 'height' properties on TilemapLayer, so it can be resized and update all children.
2016-07-22 00:09:31 +01:00
Richard Davey
ed9793e06b
Removed un-needed baseTexture dirty call.
2016-07-21 22:55:10 +01:00
photonstorm
6661952d50
Masses of changes to get tilemap layer display dimensions filtering down to linked child layers. Also allowed offset to work correctly, and fixed the display sizes with offset bounds. Exposed offset as layer.x/y. Need to duplicate in canvas variation.
2016-07-21 16:56:17 +01:00
Pete Baron
7c2dae0773
Add offset parameter to TilemapLayerGL and use it with clipping to draw a view into a map at a specified location and size in the game window.
2016-07-22 00:02:05 +12:00
Richard Davey
c36babcc1c
Code formatting and docs updates.
2016-07-21 10:45:23 +01:00
Pete Baron
aecbd7c267
Add width/height to debug log for new layers.
2016-07-21 17:13:12 +12:00
Pete Baron
29c77e10d7
Send layer width/height to PIXI.Tilemap (previously these were ignored and forgotten after the c'tor).
...
Modify resize to set displayWidth/displayHeight only.
2016-07-21 17:12:46 +12:00
Pete Baron
42a2608036
Fix createInternalLayer to use the 'base layer' rather than assume this.layers[0] was the base layer for each new one. This makes the multi-tileset, multi-layer demos work correctly.
2016-07-21 16:27:35 +12:00
Pete Baron
37a9f4fa01
Remove console warn for invalid tile index as it was firing incorrectly (when processing a base layer which only uses tiles from another tileset).
2016-07-21 16:26:32 +12:00
Pete Baron
f958567a48
Remove more dead code.
2016-07-21 15:24:05 +12:00
Pete Baron
7454eb0aa0
Add console warning when invalid tile index is used.
2016-07-21 15:23:37 +12:00
Pete Baron
70f95d2558
Remove dead code (commented out).
...
Add flag to detect when an 'internal layer' is not needed (none of the specified tileset is used in the parent layer) and skip creating one.
2016-07-21 14:58:25 +12:00
Richard Davey
5ecdee86c2
Merging in flipped tile support.
2016-07-21 02:32:08 +01:00
Richard Davey
b9d34ca843
Added debug object back in.
2016-07-20 23:44:41 +01:00
Richard Davey
d982003760
Lots more tidying up and adding jsdocs.
2016-07-20 20:06:59 +01:00
Richard Davey
ca6985e2f2
Removed lots of redundant code and tidied up bad formatting.
2016-07-20 19:27:32 +01:00
Richard Davey
7645e773dc
More tidying and jshint fixing.
2016-07-20 17:28:19 +01:00
Richard Davey
82fb296b2a
Code formatting issues.
2016-07-20 17:00:00 +01:00
Richard Davey
49fb798f60
Fixed createInternalLayer loop.
2016-07-20 16:24:06 +01:00
Richard Davey
1105e4821d
Added more info to console.warn.
2016-07-20 04:53:21 +01:00
Richard Davey
1e181fa30d
Tidying up new Tilemap classes.
2016-07-18 23:24:49 +01:00
Richard Davey
8d1b670df1
Merge remote-tracking branch 'origin/webgl-tilemap' into dev
2016-07-18 23:00:35 +01:00
Pete Baron
e3f402ec06
Clean-up and comments.
2016-07-18 13:28:20 +12:00
Pete Baron
550954210e
Clean-up and comments.
2016-07-18 13:24:29 +12:00
Pete Baron
9daf6d0525
Clean-up and comments.
2016-07-18 13:19:15 +12:00
Pete Baron
e87fc84527
comment - Tile.scale is currently unused
2016-07-18 12:40:08 +12:00
Pete Baron
9e3a7ec537
Modified the batch creation code and the batch drawing code to only insert degenerate triangles at the end of rows or when a row is broken (e.g. by some empty tiles which we won't draw at all). This should speed things up by optimising the draw, and reducing the amount of data required to describe the batch.
...
PIXI.Tilemap - _renderBatch using a local 'degenerate' flag to signal to next iteration that one should be inserted before the next triangle.
Phaser.TilemapLayerGL - add degenerate markers at end of rows and whenever a row has a break in it (e.g. empty tiles)
Phaser.Tileset - new addDegenerate function which prevents double markers in a row
2016-06-27 18:24:56 +12:00
Pete Baron
2a4049d5ef
Pass each Tile.alpha value and store it with the glBatch data.
...
NOTE: if implemented this will have to break the tile batch into separate batches based on the alpha values! Need a chat with Rich...
2016-06-27 16:09:01 +12:00
Pete Baron
61635c930e
Added offsets to render large tiles at the correct (according to Tiled editor) positions.
2016-06-27 15:21:55 +12:00
Pete Baron
b8c81c21c9
Removed resolveTileset from TilemapLayerGL, added new task to task list.
2016-06-27 15:14:08 +12:00
Pete Baron
20b3d92b9b
Fixed large tiles vanishing at screen edges by making a clear distinction between the original tilemap tile width and height, and the collision width and height of tiles for each layer. The difference between these two is now applied when calculating the region to be drawn to fill the screen.
2016-06-27 15:02:20 +12:00
Pete Baron
4f1728c62d
First working demo of multiple tileset sources specified in a single Tiled map layer being rendered as separate Batch drawing lists by the webgl renderer.
...
Phaser.Tilemap now creates internal map layers for each tileset except the first one (which will be handled by the createLayer call from the game). It also stores a reference to each tileset where the new map layers can access it.
Phaser.TilemapLayerGL uses the new tileset reference to ensure the correct base image and tile sizes are used for each new layer.
PIXI.Tilemap: added initialisation of glBatch to null in c'tor.
Phaser.TilemapParser was cleaned up to remove the now unnecessary tilemap parameter and the attempt to create layers while parsing.
2016-06-27 14:41:46 +12:00
Pete Baron
8d4733c8a5
Commit current state of development before trying something different (see last note in the progress doc). Will revert to previous commits if this attempt fails.
2016-06-27 11:46:52 +12:00
cryptographer
9fdbb2d25d
Remove assignment to obsolete tileColor property
2016-06-20 22:29:05 -04:00
gotenxds
91987eff56
Added some data to image object types.
2016-06-15 13:09:47 +03: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
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
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
Upperfoot
57e8a35226
Adds missing fixedToCamera check in Phaser.TilemapLayer.prototype._renderWebGL e4ea011353
2016-06-03 16:11:39 +01:00
photonstorm
0a5b2673ff
JSHint fixes re: #2522
2016-06-03 13:14:59 +01:00
Richard Davey
05ca827c2b
Merge pull request #2522 from Upperfoot/master
...
Fixing tileMap collision when tileMapLayer is set to a position other than 0,0
2016-06-03 12:45:37 +01:00
photonstorm
e4ea011353
TilemapLayer now adheres to fixedToCamera should it be disabled #2482
2016-06-03 12:13:01 +01:00
Richard Davey
c822cda452
TilemapLayer.postUpdate could potentially be called several times per frame (depending on device frame rate), which would cause multiple texture redraws, even though only the last texture is used during rendering. This has now been modified so that the local TilemapLayer canvas is only re-rendered once per frame, during the rendering phase, and not during the logic update phase.
2016-06-02 22:44:24 +01:00
Pete Baron
0dd3610ee4
Minor optimisation in TilemapLayerGL to remove unnecessary loop.
2016-05-26 14:10:45 +12:00
Upperfoot
55700e4fec
Take into account position of tilemap in collision
2016-05-19 08:47:31 +01:00