Sign in to follow this  

Image tile area is not an even multiple of tile size

Recommended Posts

I want to use a spritesheet with 1283x654 pixels in my game. I embedded the spritesheet in the Tiled Editor into my level.

When loading I get this warning:

Phaser.Tileset - tiles2 image tile area is not an even multiple of tile size

And when trying to render I get this error:

phaser.js:98606 Uncaught TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(CSSImageValue or HTMLImageElement or SVGImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or OffscreenCanvas)'
    at Phaser.Tileset.draw (phaser.js:98606)
    at Phaser.TilemapLayer.renderRegion (phaser.js:97327)
    at Phaser.TilemapLayer.renderFull (phaser.js:97449)
    at Phaser.TilemapLayer.render (phaser.js:97524)
    at Phaser.TilemapLayer._renderWebGL (phaser.js:96753)
    at Phaser.World.PIXI.DisplayObjectContainer._renderWebGL (phaser.js:15090)
    at Phaser.Stage.PIXI.DisplayObjectContainer._renderWebGL (phaser.js:15090)
    at PIXI.WebGLRenderer.renderDisplayObject (phaser.js:17398)
    at PIXI.WebGLRenderer.render (phaser.js:17364)
    at Phaser.Game.updateRender (phaser.js:36223)

My map and objects consist of 16x16 pixel tiles. So I tried to resize the spritesheet to 2048x1024 pixels which is a "even multiple of tile size", when the tile size is 16 pixels. But the warning and error are still the same.

Notice that the spritesheets has a 1px separation between tiles! I also tried resizing to an even multiple of 17 pixels. Same error.

How do I have to resize the image/spritesheet to get it to work? I gues it has something to do with the 1px separtion?


Thank you (spritesheet is attached)


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.