1 decade ago by yatayata
is there an easy way to find the size of the level in pixels?
i have a convoluted method like below... but seems there must be an easier way. also the maps could be different sizes, and this is not guaranteed that layer X is the largest level...
i have a convoluted method like below... but seems there must be an easier way. also the maps could be different sizes, and this is not guaranteed that layer X is the largest level...
var sampleMap = ig.game.backgroundMaps[1]; var tilesize = sampleMap.tilesize; pk.maxWidth = sampleMap.width * tilesize; pk.maxHeight = sampleMap.height * tilesize; console.log("mapSize:" + pk.maxWidth + ", " + pk.maxHeight);