Page 1 of 1

How to handle JS for cards with different fronts *and* backs?

Posted: 16 July 2020, 00:34
by panyakali
Hi devs,

I'm currently working on a card game where there's important info present not only on the fronts, but also the backs of cards. Is there an easy to associate both a front *and* a back image to the same card id using the bga stock package and then be able to easily access either when passing a card_id or type_arg from the BGA Deck components on the serverside?

Thanks,
Collin

Re: How to handle JS for cards with different fronts *and* backs?

Posted: 16 July 2020, 04:03
by paramesis
If the information on the back of the card would be known by someone familiar with the game, you could maybe get away with putting the card-back image in a tooltip that you tack on to the stock item when it is created (See BGA Guidelines for Tooltips)

Otherwise, you could override the CSS on the stock item(s) to replace the background-image whenever a user would need to see the back of a card. You would need to have the same arrangement and alignment of your front and back card sprites.