Richard Davey
759599e4d1
MapData
and ObjectLayer
will now enforce that the Tilemap.objects
property is always an array. Sometimes Tiled willl set it to be a blank object in the JSON data. This fix makes sure it is always an array. Fix #6139
2022-11-17 14:28:23 +00:00
Richard Davey
05845c6ee0
The ParseJSONTiled
function will now run a DeepCopy
on the source Tiled JSON, which prevents object mutation, fixing an issue where Tiled Object Layer names would be duplicated if used across multiple Tilemap instances. Fix #6212
2022-11-17 14:17:58 +00:00
Richard Davey
06b1adca14
Lint fix
2022-09-20 22:23:09 +01:00
samme
cfb92c6957
Give TilemapLayer origin (0, 0)
2022-09-19 08:33:33 -07:00
Richard Davey
bdbadd1339
Update CreateGroupLayer.js
2022-09-12 20:17:11 +01:00
Richard Davey
03842535c3
TilemapLayer.setTint
is a new method that allows you to set the tint color of all tiles in the given area, optionally based on the filtering search options. This is a WebGL only feature.
2022-05-24 18:27:33 +01:00
Richard Davey
4e391fa6ab
Merge pull request #6108 from samme/feature/TilemapLayer-mask
...
Add Mask component to TilemapLayer
2022-05-16 15:58:47 +01:00
samme
b6171f6e43
Add Mask component to TilemapLayer
2022-05-10 10:37:45 -07:00
Richard Davey
a4d8e87095
Fixed lint errors
2022-05-10 17:06:53 +01:00
Richard Davey
d8947e84b0
Merge pull request #6081 from adamazmil/iso-map
...
Fixes getTop for creating MatterTileBody for isometric tiles
2022-05-09 17:09:08 +01:00
Richard Davey
919fa39faa
Merge pull request #6067 from TJ09/commonjs-import-change
...
Don't reassign the return values from require()
2022-05-09 16:49:58 +01:00
samme
b60761a706
Fix the GetTilesWithinShape() area
...
Fixes #5640
2022-05-06 09:54:50 -07:00
Adam Azmil
902b916dd1
Fixes getTop for creating MatterTileBody for isometric tiles
2022-04-19 16:43:28 +08:00
T.J. L
ff4ef2872b
Don't overwrite the return values from require()
2022-04-02 01:49:19 -07:00
samme
7f37d52ba9
Docs: add CreateFromObjectsClassTypeConstructor
2022-03-30 11:05:27 -07:00
Richard Davey
59fbcc5ca3
Updated copyright year
2022-02-28 14:29:51 +00:00
Richard Davey
58f09aa006
Update Tile.js
2022-02-22 13:51:03 +00:00
Richard Davey
a4308cfa3a
Skips Canvas drawImage calls if invalid frame sizes given. Fix #5951
2022-02-03 16:44:24 +00:00
Richard Davey
476ed38e33
Removed deprecated functions
2021-12-07 17:30:56 +00:00
Richard Davey
6b7a000975
Fix eslint
2021-12-07 17:30:56 +00:00
samme
2ebbb970a5
Shorten the 'Valid tilelayer' warning
2021-11-22 08:47:56 -08:00
samme
15b62e1756
Docs: fix types in Phaser.Tilemaps.ObjectHelper#setFromJSON
2021-10-13 15:58:32 -07:00
kainage
369bf06b8e
Fix WebGL Tilemap Layer Rendering
...
* A typo was blowing up rendering the tilemaps all together
* FIx the X coord not being calculated correctly in the `batchTexture` call
2021-10-06 22:01:12 -07:00
Richard Davey
8aa6385cec
Fixed JSDocs
2021-10-06 21:39:44 +01:00
Richard Davey
6f4ceba23f
Merge pull request #5855 from lfarroco/master
...
Fix rendering of Tiled object layers on isometric maps
2021-10-06 21:11:34 +01:00
Leonardo Farroco
fc4db55b26
adds isometric ratio
2021-10-05 23:19:09 -03:00
Richard Davey
7934613e8f
The Tilemaps.Tile.getBounds
method would take a camera
parameter but then not pass it to the methods called internally, thus ignoring it. It now factors the camera into the returned Rectangle.
2021-10-05 21:52:54 +01: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
550dd2bd85
Merge pull request #5514 from etherealmachine/patch-1
...
Fix typing of MapData objects
2021-09-23 16:03:24 +01: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
f4c7cb4a6d
Fixed jsdocs. Renamed property to tileOffset
. Fixed parsing of it. #5637
2021-09-22 11:26:08 +01:00
Richard Davey
736be1abc8
tileOffset hadn't been applied to the canvas renderer #5637
2021-09-22 11:25:39 +01:00
Richard Davey
d0b5b91a5e
tileOffset is always set, so this check is redundant #5637
2021-09-22 11:25:13 +01:00
Richard Davey
d16588014f
Merge pull request #5637 from moJiXiang/fix-tilemap-offset
...
fix tilemap draw offset, maybe it is a bug, related issue #5633
2021-09-22 11:14:15 +01:00
Richard Davey
7434769faf
Merge pull request #5657 from moJiXiang/fix-bug-#5647
...
fix PutTileAt tile size with releated tileset width and height, releated bug #5647
2021-09-22 11:10:03 +01:00
Richard Davey
2771f280d2
Merge pull request #5750 from jonnytest1/master
...
assign array by index for skipped chunks
2021-09-22 11:03:44 +01:00
Richard Davey
4fd0a27b15
Formatting fix
2021-09-20 12:34:35 +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
jonnytest1
46009935b4
assign array by index for skipped chunks
...
loading breaks for layers that skip chunks with no data
2021-06-18 02:34:05 +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
mojixiang
7f161fa3ad
Update PutTileAt.js
2021-04-15 18:24:06 +08:00
moJiXiang
f686a9674b
fix PutTileAt tile size with releated tileset width and height, releated bug #5647
2021-04-15 18:04:14 +08:00
moJiXiang
7579702b7a
fix tilemap draw offset, maybe it is a bug, related issue #5633
2021-04-01 18:43:27 +08:00
Richard Davey
0c05d681e6
Update ParseTilesets.js
2021-02-16 11:44:49 +00:00
Richard Davey
e8fe16c417
Fixed function name and formatting #5292
2021-02-16 11:44:43 +00:00
Richard Davey
be2dad8a70
Merge pull request #5292 from browndragon/tiled
...
Fix up tiled json parsing.
2021-02-16 11:35:24 +00:00
Richard Davey
3493c4cd7b
Merge pull request #5523 from veleek/veleek/tiledobjectprops
...
Load Tiled object properties using names.
2021-02-10 09:30:56 +00:00
Ben Randall
40ff85bdc5
Fix IsometricWorldToTileXY result
...
IsometricWorldToTileXY returns a tile that is offset by (-0.5, 0.5)
tiles from the expected location. This fixes the function so that
Tile => World => Tile conversion returns the same value.
2021-01-28 12:25:51 -05: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
James Pettit
44fb0e2086
Fix typing of MapData objects.
...
I believe that objects is going to be an array as the result of calling this function: 7834095789/src/tilemaps/parsers/tiled/ParseObjectLayers.js (L20)
I'm not 100% sure on the type of the array elements (Phaser.Types.Tilemaps.ObjectLayerConfig), but that appears to be what ParseObjectLayers returns.
2021-01-19 15:17:12 -08:00
Richard Davey
d1ece18c93
The method TilemapLayer.weightedRandomize
has changed so that the parameter weightedIndexes
is now first in the method and is non-optional. Previously, it was the 5th parameter and incorrectly flagged as optional. This change was made to the docs but not the parameters, but now works according to the docs
2021-01-14 09:48:16 +00:00
Richard Davey
22e170e417
Updated documentation. Fix #5488
2021-01-06 11:07:05 +00:00
Richard Davey
cf2c607ac1
Canvas Tilemap Rendering is now working again. Fix #5480
2021-01-04 11:52:35 +00:00
Richard Davey
1d58620e35
Don't render debug if not orthogonal #5447
2020-12-14 09:48:29 +00:00
Richard Davey
15a6f50d2c
Fixed functions not appearing in the namespace. Fix #5432
2020-12-07 10:11:47 +00:00
Richard Davey
725271249f
No tileset? Continue the loop.
2020-12-04 13:07:14 +00:00
Richard Davey
2e91763abc
Fixes lots of default parameters
2020-11-26 12:55:40 +00:00
Richard Davey
0ee1338765
Better post pipeline call (less code)
2020-11-26 09:51:40 +00:00
Richard Davey
d2e2e86ef1
Updated accessor
2020-11-23 16:22:11 +00:00
Richard Davey
ec5da6930c
Added post pipeline support to all Game Objects
2020-11-23 16:17:13 +00:00
Richard Davey
ea2f69de3b
JSDoc fixes
2020-11-23 15:32:30 +00:00
Richard Davey
a5cb3779df
JSDoc fixes
2020-11-23 15:29:08 +00:00
Richard Davey
28d925b875
JSDoc fixes
2020-11-23 15:06:45 +00:00
Richard Davey
ecb567766b
Fixed filtering and style types
2020-11-23 10:54:14 +00:00
Richard Davey
8698a03bad
JSDoc fixes
2020-11-23 10:48:24 +00:00
Richard Davey
417f7684c3
More integer to number changes
2020-11-23 10:32:00 +00:00
Richard Davey
55093945b0
Replace integer[][] with number[][]
2020-11-23 10:24:10 +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
d852108154
JSDoc fixes
2020-11-23 10:19:39 +00:00
Richard Davey
0b589564ea
JSDoc fixes
2020-11-20 16:37:53 +00:00
Richard Davey
c5d7c94cb4
Fixed JSDocs
2020-11-20 16:20:35 +00:00
Richard Davey
ea59b47d1c
Force post pipeline skip
2020-11-20 15:18:28 +00:00
Richard Davey
750880fe5f
Fix culled tiles return
2020-11-20 14:58:43 +00:00
Richard Davey
ed756d16f1
Fixed Get Tiles Within Shape function
2020-11-20 12:39:18 +00:00
Richard Davey
377d27c8a4
Added Tile.right
and Tile.bottom
properties. Fix #5400
2020-11-20 11:51:12 +00:00
Richard Davey
0d23aea281
Allow TilemapLayers to set post pipelines
2020-11-06 17:22:32 +00:00
Richard Davey
d3c70002ea
Removed use of _tempMatrix
from all renderers
2020-11-06 09:44:29 +00:00
Richard Davey
536f08a4bf
Avoid deep diving into loads of functions
2020-10-15 11:47:11 +01:00
Richard Davey
67b787ab7c
Update GetTilesWithinWorldXY.js
2020-10-15 11:09:52 +01:00
Richard Davey
db2fdc14d1
Update GetTileAt.js
2020-10-15 11:09:37 +01:00
Richard Davey
f130f5e9a3
Fixed incorrect parameter type
2020-10-15 11:09:19 +01:00
Richard Davey
b4fed98aa2
Update SetCollisionBetween.js
2020-10-15 11:08:18 +01:00
Brown Dragon
ca0ca97f59
Fix up tiled json parsing.
...
Phaser currently discards the tiled `type` field (which is very useful for objects-from-tiles, as well as somewhat useful for handling tile variants).
It also discards wang set information, which is somewhat meaningful.
This diff adds both back; let me know if it goes too far and I can restrict it to only including `type`.
2020-10-12 19:54:14 -04:00
Richard Davey
b3a74a6d5d
ParseTilesets
will now correctly handle non-consequtive tile IDs. It also now correctly sets the maxId
property, fixing a bug where tiles wouldn't render if from IDs outside the expected range. Fix #4367
2020-10-12 13:52:31 +01: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
80287f6ee4
Path fixes
2020-10-12 11:51:05 +01:00
Richard Davey
04d80a8b5c
Allow use of old method calls for now
2020-10-12 11:50:13 +01:00
Richard Davey
24777aa327
No need for isoCullDistances
, just use existing cullPadding
properties
2020-10-12 11:42:01 +01:00
Richard Davey
607fec9450
Use a cached Rectangle for speed
2020-10-12 11:40:52 +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
fb11821730
Fixed lots of missing JSDocs
2020-10-12 11:33:33 +01:00
Richard Davey
ae4c45f14a
Fixed renderer so it draws multi tileset isometric tiles properly
2020-10-11 23:05:08 +01:00
Richard Davey
f00bb446f8
Formating fix
2020-10-11 23:04:11 +01:00
Richard Davey
9e68f41118
Formatting
2020-10-11 23:04:00 +01:00
Richard Davey
39f74d2e95
Use a cached vector to save constant allocation and fixed y culling limit
2020-10-11 23:03:52 +01:00
Richard Davey
2e50061699
Opps :)
2020-10-10 11:38:16 +01:00
Richard Davey
114201f497
Fixed tilemaps with missing function
2020-10-08 11:07:05 +01:00
Richard Davey
d9d4d74c89
Updated docs
2020-10-02 14:03:32 +01:00
Richard Davey
42d6188b7a
Now using the GetCullTilesFunction
#4922
2020-10-02 13:53:20 +01:00
Richard Davey
c0c00b66be
Tilemaps.Components.IsometricCullTiles
is a new function that culls tiles in a isometric map.
2020-10-02 13:48:52 +01:00
Richard Davey
ab753ffe10
Tilemaps.Components.StaggeredCullTiles
is a new function that culls tiles in a staggered map.
2020-10-02 13:48:42 +01:00
Richard Davey
0b8b9fb3ba
Tilemaps.Components.HexagonalCullTiles
is a new function that culls tiles in a hexagonal map.
2020-10-02 13:48:33 +01:00
Richard Davey
c44c43a553
Tilemaps.Components.StaggeredCullBounds
is a new function that calculates the cull bounds for a staggered map.
2020-10-02 13:48:22 +01:00
Richard Davey
e42b407721
Tilemaps.Components.HexagonalCullBounds
is a new function that calculates the cull bounds for a hexagonal map.
2020-10-02 13:48:13 +01:00
Richard Davey
2450a16911
Tilemaps.Components.GetCullTilesFunction
is a new function that returns the correct culling function to use.
2020-10-02 13:48:01 +01:00
Richard Davey
c66df4b94b
Deleted unused files
2020-10-02 13:47:49 +01:00
Richard Davey
9c92fccd3a
Updated to use new components
2020-10-02 13:47:36 +01:00
Richard Davey
f58ec09489
Tilemaps.Components.CullBounds
is a new function that calculates the cull bounds for an orthogonal map.
2020-10-02 13:47:27 +01:00
Richard Davey
b11e5fe1fb
Tilemaps.Components.RunCull
is a new function that runs the culling process from the combined bounds and tilemap.
2020-10-02 13:47:10 +01:00
Richard Davey
7980beaeab
Fixed references and docs #4922
2020-10-02 12:09:58 +01:00
Richard Davey
da651dc650
Fixed require filename
2020-10-02 12:06:07 +01:00
Richard Davey
1839e58581
Tidied up formatting #4922
2020-10-02 12:05:52 +01:00
Richard Davey
8ea29b6cf2
Removed console warnings
2020-10-02 12:02:48 +01:00
Richard Davey
89cec01b39
Updated types
2020-10-02 12:02:40 +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
d5561ad97a
Use cached vec2s to avoid constant vector creation
2020-10-02 11:41:11 +01:00
Richard Davey
aafd5c6cee
Use cached vec2s to avoid constant vector creation
2020-10-02 11:36:44 +01:00
Richard Davey
f03ddf033b
Formatting fix #4992
2020-10-02 11:27:50 +01:00
Richard Davey
a3f67973cd
Corrected documentation and tidied up #4992
2020-10-02 11:25:48 +01:00
Richard Davey
ffb49bdb3a
Tilemaps.Components.StaggeredTileToWorldXY
is a new function that converts staggered tile coordinates to world coordinates.
2020-10-02 11:22:48 +01:00
Richard Davey
4281bc1763
Tilemaps.Components.IsometricTileToWorldXY
is a new function that converts isometric tile coordinates to world coordinates.
2020-10-02 11:22:39 +01:00
Richard Davey
3c3c01d4d5
Tilemaps.Components.HexagonalTileToWorldXY
is a new function that converts hexagonal tile coordinates to world coordinates.
2020-10-02 11:22:30 +01:00
Richard Davey
a51e0b8a68
Tilemaps.Components.GetWorldToTileXYFunction
is a new function that returns the correct conversion function to use.
2020-10-02 11:22:18 +01:00
Richard Davey
6049701d91
Restored previous function
2020-10-02 11:22:02 +01:00
Richard Davey
a89a58bd6c
Restore previous function
2020-10-02 11:16:32 +01:00
Richard Davey
769850a400
Tilemaps.Components.StaggeredTileToWorldY
is a new function that converts a staggered Y coordinate to a world coordinate.
2020-10-02 11:16:18 +01:00
Richard Davey
0b7d3236b4
Tilemaps.Components.HexagonalTileToWorldY
is a new function that converts a hexagonal Y coordinate to a world coordinate.
2020-10-02 11:16:07 +01:00
Richard Davey
0b630754f7
Tilemaps.Components.GetTileToWorldYFunction
is a new function that returns the correct conversion function to use.
2020-10-02 11:15:54 +01:00
Richard Davey
00603c0d39
Tilemaps.Components.GetTileToWorldXFunction
is a new function that returns the correct conversion function to use.
2020-10-02 11:03:56 +01:00
Richard Davey
3eaacffb37
Restore previous function #4992
2020-10-02 11:03:03 +01:00
Richard Davey
0952421bfb
Expose the new functtions #4992
2020-10-02 11:00:30 +01:00
Richard Davey
da3d0108f4
Restore back to previous version
2020-10-02 10:59:24 +01:00
Richard Davey
9c22133bb2
Tilemaps.Components.StaggeredWorldToTileXY
is a new function that converts world coordinates to staggered tile coordinates.
2020-10-02 10:58:36 +01:00
Richard Davey
b8520f3b0d
Tilemaps.Components.IsometricWorldToTileXY
is a new function that converts world coordinates to isometric tile coordinates.
2020-10-02 10:58:18 +01:00
Richard Davey
7402d22c53
Tilemaps.Components.HexagonalWorldToTileXY
is a new function that converts world coordinates to hexagonal tile coordinates.
2020-10-02 10:57:57 +01:00
Richard Davey
7d39bf9217
Tidy return statements
2020-10-02 10:57:14 +01:00
Richard Davey
ef2d4f6d7a
Tilemaps.Components.GetWorldToTileXYFunction
is a new function that returns the correct conversion function to use.
2020-10-02 10:56:44 +01:00
Richard Davey
2537e3ff70
Tilemaps.Components.GetWorldToTileXFunction
is a new function that returns the correct conversion function to use.
2020-10-02 10:37:41 +01:00
Richard Davey
3352bd800c
Restored previous version #4992
2020-10-02 10:37:30 +01:00
Richard Davey
92b431646a
Tilemaps.Components.GetWorldToTileYFunction
is a new function that returns the correct type of translation to use.
2020-10-02 10:31:02 +01:00