Skip to content

Commit

Permalink
fix(size): put tiles in 256 pix width
Browse files Browse the repository at this point in the history
  • Loading branch information
alekmaul committed May 18, 2024
1 parent 0b6ce0d commit 7eb88c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/tilesetextractor/tileset-extractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ function onLoad() {
// Try to get as squared as possible
//
const numTiles = tiles.length;
const numRows = Math.sqrt(numTiles) | 0;
const numCols = Math.ceil(numTiles / numRows) | 0;
const numRows = Math.ceil((numTiles*tileWidth)/256) | 0; // Math.sqrt(numTiles) | 0;
const numCols = 256/tileWidth; // Math.ceil(numTiles / numRows) | 0;
extractedTilesWidth = numCols * tileWidth;
extractedTilesHeight = numRows * tileHeight;
const canvas = document.createElement("canvas");
Expand Down

0 comments on commit 7eb88c2

Please sign in to comment.