Skip to content

Commit 0e09776

Browse files
committed
Added tileFilterOptions property
1 parent dfaa91b commit 0e09776

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

‎src/physics/arcade/World.js‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,15 @@ var World = new Class({
399399
*/
400400
this._tempMatrix2 = new TransformMatrix();
401401

402+
/**
403+
* The Filtering Options passed to `GetTilesWithinWorldXY` as part of the `collideSpriteVsTilemapLayer` check.
404+
*
405+
* @name Phaser.Physics.Arcade.World#tileFilterOptions
406+
* @type {Phaser.Types.Tilemaps.FilteringOptions}
407+
* @since 3.60.0
408+
*/
409+
this.tileFilterOptions = { isColliding: true, isNotEmpty: true, hasInterestingFace: true };
410+
402411
if (this.drawDebug)
403412
{
404413
this.createDebugGraphic();
@@ -2206,10 +2215,9 @@ var World = new Class({
22062215
h += yDiff;
22072216
}
22082217

2209-
var mapData = GetTilesWithinWorldXY(x, y, w, h, null, tilemapLayer.scene.cameras.main, tilemapLayer.layer);
2218+
var options = (overlapOnly) ? null : this.tileFilterOptions;
22102219

2211-
// var mapData = GetTilesWithinWorldXY(x, y, w, h, { isColliding: true, isNotEmpty: true }, tilemapLayer.scene.cameras.main, tilemapLayer.layer);
2212-
// console.log(mapData.length);
2220+
var mapData = GetTilesWithinWorldXY(x, y, w, h, options, tilemapLayer.scene.cameras.main, tilemapLayer.layer);
22132221

22142222
if (mapData.length === 0)
22152223
{

0 commit comments

Comments
 (0)