The game is running very slowly in IE, and crashes Chrome!

This is probably because your using extensive colour tinting for lots of sprites. HTML5 does not allow for full colour blending, so when you try to draw a sprite using a colour, we create a copy of the sprite and cache it. However, the cache is pretty small (only 4 images) so if you have many colours, this will cause them to be created every time you draw them, and this will burn memory at a ferocious rate! Chrome doesn't like this at all! It's garbage collection system simply fails and it dies a horrible death. We have however added a couple of new commands to help you manage your colour tinting better; sprite_set_cache_size() and sprite_set_cache_size_ext() give you fine control over the sizes of the cache for each sprite/image, and should allow you to colour whatever you need to. Be warned however, each sprite you colour will use memory, so you probably shouldn't just set all them to large numbers as you'll be back to having bad things happen. This also causes issues for blending fonts, so care must be taken with them as well.

Have more questions? Submit a request

0 Comments

Article is closed for comments.