1 decade ago by Husten
hi,
i working on a mobilegame and the designs are 1024x768 and i create the canvas to the max i have with a scale. like this
ig.main( '#canvas', MyGame, 10, 1024, (window.docHeight/(window.docWidth/1024)), window.docWidth/1024);
so the canvas use the max screensize. i use the 1024 designs, scale the width and cut the height. works fine for the most resolutions.
but with 854x480 i ve got the error:
IndexSizeError: Index or size is negative or greater than the allowed amount in image.js line 133
when i draw for example a backgroundimage.
i think its a problem with the rounding, cause if i use this formula the result for height is only 479,999999....
plz help :)
i working on a mobilegame and the designs are 1024x768 and i create the canvas to the max i have with a scale. like this
ig.main( '#canvas', MyGame, 10, 1024, (window.docHeight/(window.docWidth/1024)), window.docWidth/1024);
so the canvas use the max screensize. i use the 1024 designs, scale the width and cut the height. works fine for the most resolutions.
but with 854x480 i ve got the error:
IndexSizeError: Index or size is negative or greater than the allowed amount in image.js line 133
when i draw for example a backgroundimage.
i think its a problem with the rounding, cause if i use this formula the result for height is only 479,999999....
plz help :)