scoreCtrl during refresh

Game development with Board Game Arena Studio
Post Reply
User avatar
Rudolf
Posts: 566
Joined: 24 December 2011, 23:04

scoreCtrl during refresh

Post by Rudolf »

Hello,
I cannot change the value of player_score during setup in Javascript.
I need to change it after refresh
I've tried 2 ways:
* document.getElementById('player_score_'+player_id).innerHTML= - $data; does not change anything
* this.scoreCtrl[ player_id ].setValue( - $data); scoreCtrl does not exist here.
I think scoreControl is created after so I cannot change it.

Is there any solution?
thanks.
User avatar
Quinarbre
Posts: 140
Joined: 15 December 2013, 23:26

Re: scoreCtrl during refresh

Post by Quinarbre »

Yeah, there are a few things (logs too for instance) that you wish you could change at setup but that aren't initialized yet.
The only workaround I found was to use onEnteringState, which is normally called just after setup, but once everything else on the page is in place.
Just try to find a way (global boolean, some simple test...) to avoid doing it everytime you enter a state.
Post Reply

Return to “Developers”