Stock cards : vertical overlapping

Game development with Board Game Arena Studio
Post Reply
User avatar
Tabaskov
Posts: 24
Joined: 18 July 2016, 10:18

Stock cards : vertical overlapping

Post by Tabaskov »

Hi to the developer community,

the Stock feature is super convenient to use, especially with many cards families.
However I'm having a design issue with the cards overlapping. There are two schools of thought: do I put my collection of cards of the same type horizontally or vertically? Horizontally is not a problem, the setOverlap looks very good.
However, for this game, in practice, on a table, people tend to put their cards vertically... and this is where it gets complicated.
The editor would also like to see how it would look like to group cards of the same family vertically, but I don't see how to do that easily with the Stock library. What solutions can you offer me?

Thanks ;)
User avatar
SwHawk
Posts: 133
Joined: 23 August 2015, 16:45

Re: Stock cards : vertical overlapping

Post by SwHawk »

Hey,

In order to do that, you need to modify Stock's source code. I've done it in one of my projects, you can take a look at it here : https://gitlab.swhawk.eu/silver/cosmosempiresbga/-/blob/master/modules/js/Classes/COEStock.js.

You can ask me over the bga-developers discord how you can make it work. Of course you can ask me here, but it might take a little longer.

Basically you need to include this into your project (you should take a look at the docs here in order to do so), and when you've created your modified Stock component, you need to add :

Code: Select all

let myStock = new ModifiedStock();
myStock.horizontal_overlap = hOverlap_value;
myStock.vertical_overlap = vOverlap_value;
At least vertical overlap can now accept negative value showing the bottom of the card, and the cards stacking upwards, instead of downwards (using a positive overlap)

Hope this helps.

Edit: It seems that I've lost some of my BBCode-Fu, edited to correct the links
User avatar
Tabaskov
Posts: 24
Joined: 18 July 2016, 10:18

Re: Stock cards : vertical overlapping

Post by Tabaskov »

Thank you very much,
this track seems interesting to me, I will look at it...
Post Reply

Return to “Developers”