Page 1 of 1

preloading images?

Posted: 12 May 2020, 01:46
by cmgames
I am developing a game where the scoring happens at three times during the game.

During scoring, I flash (for a couple seconds) the score generated from each section of the board (using fadeOutAndDestroy).

However, the first time the scoring occurs, the background image for the scoring area does not appear until just before the zone disappears.

Is there a way to pre-load images (in the code I have access to) so that when the time comes to call them, they can appear right away?

~cmgames

Re: preloading images?

Posted: 12 May 2020, 09:37
by laedit
One way to "preload" may be to add an <img with the image url and display:none.

Re: preloading images?

Posted: 12 May 2020, 10:46
by DoctorPelusa
In theory all images in the appropriate folder are preloaded by the framework: http://en.doc.boardgamearena.com/Game_a ... es_loading

Otherwise you can use css as laedit said, or search the web for Javascripts that can do that as well.