Resolution in view.php

Game development with Board Game Arena Studio
Post Reply
User avatar
AxeCrazy
Posts: 18
Joined: 15 March 2014, 01:07

Resolution in view.php

Post by AxeCrazy »

Hi guys,
With my first game in alpha i get questions on why the board is only 740 px wide.
I did this to make it fit nicely in a mobile device to, but just wondering.
When i make special css rules for mobile i could upscale the board on desktop, but since i positiion several game elements absolute within the main board i need to know the resolution of the client playing the game, so i can apply a multiplier for this absolute positioning.

Is there a way to get this info within the view.php file?
User avatar
firgon
Posts: 30
Joined: 14 October 2014, 06:27

Re: Resolution in view.php

Post by firgon »

I think it's a config in gameinfos.inc.php (you can change it but i guess 740 is default value)

so i guess $gameinfos in an array you can get in your view (but don't know exactly how)
User avatar
RicardoRix
Posts: 2117
Joined: 29 April 2012, 23:43

Re: Resolution in view.php

Post by RicardoRix »

If this helps. You can hook into the onScreenWidthChange change event, simply by defining a function.
https://en.doc.boardgamearena.com/index ... arch&go=Go

I also manually call the function in setup just to be sure.

Code: Select all

	onScreenWidthChange: function()
	{					
		var offsetWidth = $('game_play_area').offsetWidth;
I had a feeling that 740 is fixed no matter what, but I could be wrong. But at least it's at this point that the player panels move to the top.
Post Reply

Return to “Developers”