Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by roger

Hi,

I'm drawing a big backgroundMap and It's drawing with no problem in Firefox but I get an error when i play the game in iPhone. This errors says: "DOM Exception 1: Index or size was negative, or grater than the allowed value".
And the error comes from impact/image.js

This is not happening when I put 10 in tilesize but obviously I don't see all the image...

Is there any limit for the tilesize?

see down my code:

this.tempBackground = new ig.BackgroundMap( 640, this.dataBackground, "media/1c.png");
this.tempBackground.setScreenPos( 0, 0 );

...

this.tempBackground.draw();

Thanks!

1 decade ago by dominic

You're probably drawing an area that's larger than your image. I.e. if your image is 640x480 and you're using a tilesize of 640, Impact attempts to draw an image with a size of 640x640 - that doesn't work. Some browsers ignore the size difference, but Firefox doesn't.

Since it seems you want to draw a background image, not a background map, you should just create an image instead.
this.backgroundImage = new ig.Image( "media/1c.png" );

...

this.backgroundImage.draw( 0, 0 );
Page 1 of 1
« first « previous next › last »