Commit graph

541 commits

Author SHA1 Message Date
Rui Han
fababac09a
Change the note in documentation of id to be more descriptive 2023-07-09 23:57:02 +08:00
Rui Han
a3b3eb1d7a
Record layer id from Tiled map json in LayerData config 2023-07-07 18:14:21 +08:00
Rui Han
90209b3d10
Add layer id to ObjectLayer 2023-07-07 18:11:52 +08:00
Rui Han
f421546e39
Add layer id to LayerData 2023-07-07 18:11:13 +08:00
Richard Davey
8ff50da910 Fixed return type 2023-04-10 17:49:42 +01:00
Richard Davey
950f0a8363 Tilemap.getLayerIndex will now return null if a given TilemapLayer instance doesn't belong to the Tilemap or has been destroyed. 2023-04-10 17:43:02 +01:00
Richard Davey
0f72a9781b Updated jsdocs 2023-04-03 18:35:25 +01:00
Richard Davey
f97d4d2477
Merge pull request #6400 from imothee/addTilesetImage-tilesetOffset
Adds tileOffset param to Phaser.Tilemaps.Tilemap#addTilesetImage
2023-03-31 14:34:53 +01:00
Richard Davey
84dcdd9719 Fixed eslint formatting errors #6429 2023-03-31 14:23:26 +01:00
Richard Davey
b65d4b48c6 Fixed jsdocs #6429 2023-03-31 14:23:13 +01:00
Richard Davey
c32c4ccfe4
Merge pull request #6429 from rexrainbow/tilemap-hexagon-staggeraxis-x
Support staggeraxis-x, staggerindex-odd
2023-03-31 14:18:49 +01:00
samme
e9e87bf8b7 Clear tiles when destroying tilemap 2023-03-26 14:31:52 -07:00
samme
3d386a055d Save tileset index, fix putting empty tile
Adds Phaser.Tilemaps.Tilemap#tiles

Fixes #6353
2023-03-26 09:34:25 -07:00
Rex
bc1fcf7357 Suport staggerIndex-even with staggerAxis-y and staggerAxis-x 2023-03-25 20:47:45 +08:00
Rex
65c0f9f73b Support staggeraxis-x, staggerindex-odd 2023-03-25 11:54:41 +08:00
Richard Davey
f8faec2702 Fixed reference and removed mapData check 2023-03-22 18:23:36 +00:00
Richard Davey
c850e85ca4 The TilemapLayer.skipCull feature wasn't being applied correctly for Isometric, Hexagonal or Staggered tiles, only for Orthographic tiles (the default). It will now respect the skipCull property and return all tiles during culling if enabled. Fix #5524 2023-03-22 18:01:34 +00:00
Richard Davey
ae449ad27b Added missing PostPipeline class 2023-03-22 17:45:31 +00:00
Richard Davey
85d1673cce Set directly on Sprite if a property, otherwise use setData. Fix #6391 2023-03-22 16:41:13 +00:00
Tim Marks
f01cc23b41 Adds tileOffset param to addTilesetImage function 2023-02-20 18:41:39 -08:00
samme
c7148b3378 Docs: createFromObjects() description
#5698
2023-02-15 13:40:17 -08:00
Pavle Goloskokovic
815e1460d6 TilemapFilterCallback return value type fix 2023-01-17 15:19:36 +01:00
Richard Davey
468bf7821d Updated copyright year 2023-01-02 17:36:27 +00:00
Richard Davey
58533686d5
Merge pull request #6321 from samme/docs/constructor-types
Docs: change "Constructor" types to `function`
2022-12-19 16:43:31 +00:00
samme
390b4f577b Docs: correct type for CreateFromTiles() etc.
`replacements` is nullable
2022-12-19 03:28:40 -08:00
samme
09be12612b Docs: change "Constructor" types to function
- Phaser.Types.GameObjects.Group.GroupClassTypeConstructor
- Phaser.Types.GameObjects.Particles.ParticleClassConstructor
- Phaser.Types.Tilemaps.CreateFromObjectsClassTypeConstructor

Fixes #6318
2022-12-16 15:37:09 -08:00
Oni
6d9eebd45e Add additional type to orientation property 2022-12-13 16:14:42 +01:00
Christen Lofland
e52f1738ef Fix Issue #6301 causing tilemap collisions to fail. 2022-11-30 15:28:59 -06:00
Richard Davey
14ddd29fbd Fixed TS errors 2022-11-30 15:06:52 +00:00
Richard Davey
c0a072b37d Update GetTileCorners.js 2022-11-28 18:34:20 +00:00
Richard Davey
7f8a4eebf4 Update GetTileCorners.js 2022-11-28 18:33:36 +00:00
Richard Davey
91c731d609 Update GetTileCornersFunction.js 2022-11-28 18:32:06 +00:00
Richard Davey
4253db9a08 The Tilemap and TilemapLayer classes have a new method getTileCorners. This method will return an array of Vector2s with each entry corresponding to the corners of the requested tile, in world space. This currently works for Orthographic and Hexagonal tilemaps. 2022-11-28 18:31:20 +00:00
Richard Davey
f2aa880797 Update HexagonalTileToWorldXY.js 2022-11-28 18:16:01 +00:00
Richard Davey
3676881d57 Added comments 2022-11-28 17:34:18 +00:00
Richard Davey
f3e90518e5 Removed the HexagonalTileToWorldY function as it cannot work without an X coordinate. Use HexagonalTileToWorldXY instead. 2022-11-28 17:34:11 +00:00
Richard Davey
31ea1dc6da Recoded the point conversion math in the HexagonalTileToWorldXY function as it was incorrect. Now returns world coordinates correctly. 2022-11-28 17:33:48 +00:00
Richard Davey
e760178365 Tile.copy will now use the DeepCopy function to copy the Tile.properties object, as otherwise it just gets copied by reference. 2022-11-28 13:35:15 +00:00
Richard Davey
27bbf9b2f5 Tilemap.copy would error if you copied a block of tiles over itself, even partially, as it tried to copy already replaced tiles as part of the function. It will now copy correctly, regardless of source or destination areas. Fix #6188 2022-11-28 13:35:04 +00:00
Richard Davey
18b25d5bc1 Update GetTilesWithin.js 2022-11-28 13:34:57 +00:00
Richard Davey
949852d8d5 Recoded the point conversion math in the HexagonalWorldToTileXY function as it was incorrect. Now detects any dimension hexagon correctly. Fix #5608 2022-11-24 23:31:49 +00:00
Richard Davey
5139d22814 Added debug code commented out 2022-11-24 23:11:11 +00:00
Richard Davey
84ef41f470 Fixed math for any layer scale 2022-11-24 23:11:01 +00:00
Richard Davey
ddd4eeaa53 Now works - time to tidy up 2022-11-24 21:29:58 +00:00
Richard Davey
d570b9b26b Debugging hex coords 2022-11-24 18:54:17 +00:00
Richard Davey
c4b9dbc260 Added staggerAxis and staggerIndex 2022-11-24 18:54:10 +00:00
Richard Davey
b065452cc4 Debugging 2022-11-24 13:44:52 +00:00
Richard Davey
4bf7e1978f WorldToTileXY now does all the calculations and X and Y just call it. 2022-11-24 12:51:18 +00:00
Richard Davey
36bbc88995 Removed HexagonalWorldToTileY as it cannot work without an X value 2022-11-24 12:41:42 +00:00
Richard Davey
cf657f4fc7 Calling Tilemap.worldToTileX or worldToTileY on a Isometric or Hexagonal Tilemap will now always return null instead of doing nothing, as you cannot convert to a tile index using just one coordinate for these map types, you should use worldToTileXY instead. 2022-11-24 00:42:13 +00:00