container with id -right-side moved to top when screen is wider

Game development with Board Game Arena Studio
Post Reply
User avatar
developgame
Posts: 107
Joined: 15 June 2020, 20:56

container with id -right-side moved to top when screen is wider

Post by developgame »

I love how the player panels -container "right-side" moves to top of screen for when screens width are smaller than 980px.

My project's game board is very wide. How can I have container "right-side" move to the top of screen when screen width is < 1200px rather than 980px?

Thanks for any help!
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: container with id -right-side moved to top when screen is wider

Post by Tisaac »

developgame wrote: 09 April 2023, 19:12 I love how the player panels -container "right-side" moves to top of screen for when screens width are smaller than 980px.

My project's game board is very wide. How can I have container "right-side" move to the top of screen when screen width is < 1200px rather than 980px?

Thanks for any help!
No easy way, the threshold is hard coded in bga code
User avatar
developgame
Posts: 107
Joined: 15 June 2020, 20:56

Re: container with id -right-side moved to top when screen is wider

Post by developgame »

Thanks Tisaac! I REally appreciate how you help us newbies! :D
Tisaac wrote: 09 April 2023, 23:22
developgame wrote: 09 April 2023, 19:12 I love how the player panels -container "right-side" moves to top of screen for when screens width are smaller than 980px.

My project's game board is very wide. How can I have container "right-side" move to the top of screen when screen width is < 1200px rather than 980px?

Thanks for any help!
No easy way, the threshold is hard coded in bga code
User avatar
IndianaScones
Posts: 20
Joined: 07 June 2012, 07:04

Re: container with id -right-side moved to top when screen is wider

Post by IndianaScones »

You should be able to do it with this in your JS Setup:

Code: Select all

if( screen.width <= 1200 ) {
	dojo.removeClass('ebd-body', 'desktop-version');
	dojo.addClass('ebd-body', 'mobile-version');
}
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: container with id -right-side moved to top when screen is wider

Post by Tisaac »

IndianaScones wrote: 11 April 2023, 03:12 You should be able to do it with this in your JS Setup:

Code: Select all

if( screen.width <= 1200 ) {
	dojo.removeClass('ebd-body', 'desktop-version');
	dojo.addClass('ebd-body', 'mobile-version');
}
Have you tested this one ?
User avatar
IndianaScones
Posts: 20
Joined: 07 June 2012, 07:04

Re: container with id -right-side moved to top when screen is wider

Post by IndianaScones »

Yep, I experimented with something like this a while ago when I was early in working on the overall layout but abandoned it because it wasn't solving my problem. So I have tested it but not extensively. It worked fine in the short amount of time I was using it.

If you look at Wingspan, it is set to be in "mobile mode" at all times, as ebd-body has the .mobile-version class even in desktop games.
Post Reply

Return to “Developers”