phaserjs / phaserjs/phaser

Isometric getTilesWithinShape behavior

Open
#6,671 3 comments 0 reactions 1 assignee View on GitHub

@zekeatchan is already working on this.

Since Jan 22, 2025.

🗄️Backlog 🗺️ Tilemap
Dominant language
JavaScript
Stars
40.3k
Forks
7.2k
PR merge metrics
No merged PRs in 30d

Description

Version

  • Phaser Version: 3.70
  • Operating system: Windows 10
  • Browser: Chrome 119

Description

Expecting to be circle in isometric tilemaps

For radius 100:
image

For radius 150:
image

Similar behavior for Rectangle

var tiles = layer1.getTilesWithinShape(new Phaser.Geom.Rectangle(400, 300, 100, 100));
tiles.forEach(tile => {
  tile.tint = 0xff0000;
});

image

Example Test Code

Tested here:

https://labs.phaser.io/edit.html?src=src/tilemap/isometric/isometric%20test.js&v=3.70.0

and added this:

var tiles = layer1.getTilesWithinShape(new Phaser.Geom.Circle(400, 300, 100));
tiles.forEach(tile => {
  tile.tint = 0xff0000;
});

and hidden layers 2-5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.