Skip to content

Commit

Permalink
Fixed issue where Tilemap doesn't render since Pixi v8.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
erikhoj committed Feb 1, 2025
1 parent 77c0474 commit 5f36100
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/Tilemap.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-unused-vars */
import { Bounds, Container, groupD8, State, Texture, TextureSource } from 'pixi.js';
import { Bounds, Container, groupD8, State, Texture, TextureSource, ViewContainer } from 'pixi.js';
import { settings } from './settings';
import { TilemapInstruction, TilemapPipe } from './TilemapPipe';
import { TileTextureArray } from './TileTextureArray';
Expand Down Expand Up @@ -56,7 +56,7 @@ export const POINT_STRUCT_SIZE = (Object.keys(POINT_STRUCT).length / 2);
* .tile('brick_wall.png', 0, 100);
* });
*/
export class Tilemap extends Container
export class Tilemap extends ViewContainer
{
// TODO: make default color work
/**
Expand Down Expand Up @@ -124,6 +124,18 @@ export class Tilemap extends Container
/** The interleaved geometry of the tilemap. */
private pointsBuf: Array<number> = [];

protected updateBounds(): void {
const bounds = this.tilemapBounds;

this._bounds.minX = bounds.minX;
this._bounds.maxX = bounds.maxX;
this._bounds.minY = bounds.minY;
this._bounds.maxY = bounds.maxY;
}

public batched: boolean;


/**
* @param tileset - The tileset to use for the tilemap. This can be reset later with {@link Tilemap.setTileset}. The
* base-textures in this array must not be duplicated.
Expand Down

0 comments on commit 5f36100

Please sign in to comment.