Skip to content

Commit

Permalink
feat: Add IsometricTile.data storage (#2879)
Browse files Browse the repository at this point in the history
Add missing arbitrary data storage in `IsometricTile`s that exists on normal `Tile`s
  • Loading branch information
eonarheim authored Jan 13, 2024
1 parent a87b808 commit fa257a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Added

- Added arbitrary data storage in isometric tiles, `ex.IsometricTile.data` this brings it into feature parity with normal `ex.Tile.data`
- New graphics events and hooks that allow you to hook into graphics drawing before or after any drawing transformations have been applied
* `Actor.graphics.onPreTransformDraw` with the corresponding event `.on('pretransformdraw')`
* `Actor.graphics.onPostTransformDraw` with the corresponding event `.on('posttransformdraw')`
Expand Down
5 changes: 5 additions & 0 deletions src/engine/TileMap/IsometricMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ export class IsometricTile extends Entity {
return this.pos.add(vec(0, this.map.tileHeight / 2));
}

/**
* Arbitrary data storage per tile, useful for any game specific data
*/
public data = new Map<string, any>();

/**
* Construct a new IsometricTile
* @param x tile coordinate in x (not world position)
Expand Down

0 comments on commit fa257a9

Please sign in to comment.