Commit graph

123 commits

Author SHA1 Message Date
samme
c3335db081 Docs: Tilemap#createFromObjects description 2023-05-04 16:38:39 -07: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
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
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
samme
390b4f577b Docs: correct type for CreateFromTiles() etc.
`replacements` is nullable
2022-12-19 03:28:40 -08: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
c8b40de29c Improved jsdocs 2022-11-24 00:41:55 +00:00
Richard Davey
ce12d63d01 The Tilemap.destroyLayer method would throw an error "TypeError: layer.destroy is not a function". It now correctly destroys the TilemapLayer. Fix #6268 2022-11-17 14:34:46 +00:00
Richard Davey
59fbcc5ca3 Updated copyright year 2022-02-28 14:29:51 +00:00
Richard Davey
476ed38e33 Removed deprecated functions 2021-12-07 17:30:56 +00:00
samme
2ebbb970a5 Shorten the 'Valid tilelayer' warning 2021-11-22 08:47:56 -08:00
Leonardo Farroco
fc4db55b26 adds isometric ratio 2021-10-05 23:19:09 -03:00
Leonardo Farroco
64f7b992be linting 2021-10-03 16:35:02 -03:00
Leonardo Farroco
687942e77e Change positioning for isometric object layer from Tiled 2021-10-03 16:30:05 -03:00
Richard Davey
5dfab5f5d9 eslint and jsdoc fixes for #5697 2021-09-23 16:02:52 +01:00
Richard Davey
d44e8e782e
Merge branch 'master' into tilemap 2021-09-23 15:47:47 +01:00
Richard Davey
4ab8a4d3a3
Merge pull request #5767 from mayacoda/master
Fix getBounds for creating MatterTileBody for staggered tiles
2021-09-20 12:26:55 +01:00
Richard Davey
4b011e2225
Merge pull request #5790 from samme/fix/createFromObjects-offset
Fix offset for non-tile objects in createFromObjects()
2021-09-20 12:12:41 +01:00
samme
08a600edcb Docs: correct CreateFromObjectLayerConfig.classType
Fixes #5831
2021-09-14 09:10:09 -07:00
samme
788bcb4330 Fix offset in createFromObjects()
Fixes #5789
2021-07-22 11:08:32 -07:00
Maya Nedeljkovich
20ebc6f7a2 Fix getBounds for creating MatterTileBody for staggered tiles 2021-06-30 15:21:13 +02:00
Brown Dragon
a420b6e46a Improve ObjectHelper docs even if they are just internal only 2021-05-21 09:49:19 -04:00
Brown Dragon
02e67e682f Addresses https://github.com/photonstorm/phaser/issues/5697
This diff adds:
* `type` support to `createFromObjects`. See https://doc.mapeditor.org/en/stable/manual/custom-properties/#typed-tiles for the description in Tiled; this is currently not supported as a parameter, and its usage is documented within the diff.
* `createFromObjects` will also examine the tileset. As per the above link, created objects are supposed to inherit properties from the tile with the same gid, but Phaser doesn't do that right now. After this diff it optionally will, by passing an additional parameter to `createFromObjects`.
> NOTE: I'd be very happy to make this a default behavior, but that's somewhat backwards breaking
* `createFromObjects` will attempt to use the same texture and frame as Tiled when creating the object. This will behave poorly if there is no such frame (for instance, if the texture were loaded with `this.load.image` instead of `this.load.spritesheet`, or using different geometry. However, the current behavior draws missingimage, so this is a strong improvement.
2021-05-13 17:05:03 -04:00
Ben Randall
fea65988f4 Load Tiled object properties.
Tiled objects have properties as an array of objects like:

  { name: ..., type: ..., value: ...}

Update the parser to load these using the name/value properties instead
of just treating it as an array and loading properties named '0', '1',
etc.  This is the same as how properties are handled in ParseTilesets.js
2021-01-23 14:59:33 -05:00
Richard Davey
1d58620e35 Don't render debug if not orthogonal #5447 2020-12-14 09:48:29 +00:00
Richard Davey
2e91763abc Fixes lots of default parameters 2020-11-26 12:55:40 +00:00
Richard Davey
417f7684c3 More integer to number changes 2020-11-23 10:32:00 +00:00
Richard Davey
3f511a73cd Replace integer[] with number[] 2020-11-23 10:23:10 +00:00
Richard Davey
02c34cd64e Replace integer with number 2020-11-23 10:22:13 +00:00
Richard Davey
e526af7cb9 Lint fix 2020-10-12 13:38:57 +01:00
Richard Davey
3e2041a3c5 Overhauled createFromObjects to make it much more useful. Fix #3817 #4613 2020-10-12 13:31:30 +01:00
Richard Davey
04d80a8b5c Allow use of old method calls for now 2020-10-12 11:50:13 +01:00
Richard Davey
0ba1f08f80 The Static and Dynamic Tilemap Layer objects have been removed and consolidated into the new TilemapLayer class. 2020-10-12 11:40:40 +01:00
Richard Davey
f00bb446f8 Formating fix 2020-10-11 23:04:11 +01:00
Richard Davey
d9d4d74c89 Updated docs 2020-10-02 14:03:32 +01:00
Richard Davey
04ecc38a61 Fixed JSDocs and const path #4922 2020-10-02 11:57:37 +01:00
Richard Davey
b09197d8cb Added proper JSDocs and fixed private accessors #4922 2020-10-02 11:53:23 +01:00
Richard Davey
398bdf4314 Tilemap.hexSideLength is a new property that holds the length of the hexagon sides, if using Hexagonal Tilemaps. 2020-10-02 10:30:08 +01:00
Richard Davey
c3c35322c4
Merge pull request #4992 from svipal/master
Preliminary PR for isometric support
2020-10-02 09:42:47 +01:00
Richard Davey
8d51e8ab2c Fix #4859 2020-09-23 12:59:03 +01:00
Svipal
299f83c13d fixed conflicts 2020-09-19 10:56:05 +02:00
svipal
79fe9abc6e finished updating culling system 2020-09-18 17:16:52 +02:00
Svipal
809d0b7495 merged master 2020-08-09 13:13:09 +02:00