Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Pixelbox

Create 2D games in JavaScript, made easier · By Cedric Stoquer

Bug in Texture's Tiles per Line

A topic by IgorMoreno created May 09, 2020 Views: 172 Replies: 2
Viewing posts 1 to 2
(+1)

While prototyping I came across a sort of bug in the Texture module. Both the canvas2D and webGL implementations use  ~~settings.tileSize.width and ~~settings.tileSize.height to account for different tile sizes as set in the editor.

However, the TILES_PER_LINE variable just below it is hardcoded to 16, which would be the case with the default 8x8 tiles. It was a simple fix to change the value to what I needed (8 tiles per line, 16x16 tiles), but it would be nice to have it automatically set as so in a future update.

Cheers!

Things are working the other way around: a tilesheet is alway 16 x 16 tiles, and its dimension in pixels is set according to tile sizes.

In your case, 16 x16px tile size will result to a 256 x 256px tilesheet. 

Great, I get it now! Thanks! :)