Page 2 of 2

Re: Four Color Deck of Cards Sprite

Posted: 27 June 2020, 23:39
by Xom
I changed to a lighter blue to be more distinct from the black spades.
cards.png
cards.png (107.75 KiB) Viewed 929 times

Re: Four Color Deck of Cards Sprite

Posted: 28 June 2020, 22:40
by Xom
Dev question:

I want to allow 4-color or 2-color deck as a preference, but only if it's possible without making all players load all images. Is it?

(Does BGA pre-load the sprite PNGs, or does it wait for them to be referenced by the CSS?)

Re: Four Color Deck of Cards Sprite

Posted: 29 June 2020, 11:23
by MikeIsHere
Would this help solve your problem

http://en.doc.boardgamearena.com/Game_i ... ge_loading
dontPreloadImage( image_file_name )

Using dontPreloadImage, you tell the interface to not preload a specific image in your img directory.

Example of use:

this.dontPreloadImage( 'cards.png' );
This is particularly useful if for example you have 2 different themes for a game. To accelerate the loading of the game, you can specify to not preload images corresponding to the other theme.

Another example of use: in "Gosu" game with Kamakor extension, you play with 5 sets of cards among 10 available. Cards images are organized by sets, and we only preload the images corresponding to the 5 current sets with ensureSpecificGameImageLoading( image_file_names_array ).