Page 1 of 1

Cards spread on refresh

Posted: 07 October 2021, 16:09
by DargorX
Hi guys,

I am developing a card game using Stock objects.
On refreshing the game all cards spread over his respective stocks like an accordion. How can I avoid this behavior? This is very annoying!!
I want the cards fixed on his "final" position.

Thanks.

Re: Cards spread on refresh

Posted: 07 October 2021, 16:39
by robinzig
If the layout is going wrong on refresh, it suggests something is wrong with your Javascript "setup" method.

Without seeing the relevant code that you have for setting up this Stock, and ideally a screenshot of the problem as well, it's hard to say any more...

Re: Cards spread on refresh

Posted: 07 October 2021, 17:15
by DargorX
DargorX wrote: 07 October 2021, 16:09 Hi guys,

I am developing a card game using Stock objects.
On refreshing the game all cards spread over his respective stocks like an accordion. How can I avoid this behavior? This is very annoying!!
I want the cards fixed on his "final" position.

Thanks.
It's a game on alpha, you can see what I'm talking about by loading (or refreshing) this table: https://boardgamearena.com/2/castlesofc ... =206250775

Re: Cards spread on refresh

Posted: 07 October 2021, 23:31
by ShaPhi7
Not sure how to fix, but if I've understood correctly, your cards appear spread out initially after a refresh, after a few seconds, they all pile together to their "final" position?

If so, then I have seen the same thing happen on multiple games including Incan Gold and Grand Bazaar. It may a more general bug, rather than something specific to your game. I use an android device.

Re: Cards spread on refresh

Posted: 08 October 2021, 11:13
by DargorX
ShaPhi7 wrote: 07 October 2021, 23:31 Not sure how to fix, but if I've understood correctly, your cards appear spread out initially after a refresh, after a few seconds, they all pile together to their "final" position?

If so, then I have seen the same thing happen on multiple games including Incan Gold and Grand Bazaar. It may a more general bug, rather than something specific to your game. I use an android device.
I noticed this behavoir in other games too, but not on Jaipur, and it's referenced on documentation when talking about the stock component.

Re: Cards spread on refresh

Posted: 09 October 2021, 16:30
by MikeUcc
I had some odd issues like this as well
Have you tried using the updateDisplay() method on the Stock item in question?

You could put this call in the OnEnteringState function if it seems to happen when entering a specific state

Re: Cards spread on refresh

Posted: 09 October 2021, 23:07
by DargorX
MikeUcc wrote: 09 October 2021, 16:30 I had some odd issues like this as well
Have you tried using the updateDisplay() method on the Stock item in question?

You could put this call in the OnEnteringState function if it seems to happen when entering a specific state
updateDisplay doesn't do the trick, but removing centerItems = true does!

Thanks for the suggestions.