preloading images?

Game development with Board Game Arena Studio
Post Reply
User avatar
cmgames
Posts: 16
Joined: 05 October 2016, 22:14

preloading images?

Post 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
laedit
Posts: 27
Joined: 07 April 2020, 08:47
Contact:

Re: preloading images?

Post by laedit »

One way to "preload" may be to add an <img with the image url and display:none.
User avatar
DoctorPelusa
Posts: 36
Joined: 16 March 2020, 12:32

Re: preloading images?

Post 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.
Post Reply

Return to “Developers”