<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.doc.boardgamearena.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=BROT42</id>
	<title>Board Game Arena - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.doc.boardgamearena.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=BROT42"/>
	<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/Special:Contributions/BROT42"/>
	<updated>2026-11-25T14:42:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=30861</id>
		<title>Your game mobile version</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=30861"/>
		<updated>2026-07-24T17:23:13Z</updated>

		<summary type="html">&lt;p&gt;BROT42: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Studio_Framework_Navigation}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Board Game Arena supports mobile phones and tablets. Most games are already playable on touch devices, but their layout and interactions still need to work on narrow screens.&lt;br /&gt;
&lt;br /&gt;
== Declare your interface minimum width ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;game_interface_width.min&amp;lt;/code&amp;gt; is the smallest logical width at which your game remains usable. The default is 740 pixels.&lt;br /&gt;
&lt;br /&gt;
When the available game area is at least this wide, the game is displayed at its normal scale. When it is narrower, &amp;lt;code&amp;gt;game_interface_width.autoscale&amp;lt;/code&amp;gt; determines how BGA handles the difference. With the default &amp;lt;code&amp;gt;autoscale: true&amp;lt;/code&amp;gt;, BGA scales the game content down to fit. For example, a minimum width of 740 pixels displayed in 390 pixels of available space is scaled to approximately 53%.&lt;br /&gt;
&lt;br /&gt;
Declare it in &#039;&#039;&#039;gameinfos.jsonc&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;game_interface_width&amp;quot;: {&lt;br /&gt;
      // Smallest usable width. Default: 740&lt;br /&gt;
      &amp;quot;min&amp;quot;: 540,&lt;br /&gt;
  &lt;br /&gt;
      // Default: true&lt;br /&gt;
      &amp;quot;autoscale&amp;quot;: true&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The declared width must actually work. If you declare 540 pixels, the complete interface must remain usable at 540 pixels.&lt;br /&gt;
&lt;br /&gt;
{{Info|1=&lt;br /&gt;
&#039;&#039;&#039;Autoscaling is not a substitute for adapting your interface to narrow screens.&#039;&#039;&#039; Keep &amp;lt;code&amp;gt;game_interface_width.min&amp;lt;/code&amp;gt; no larger than the interface genuinely needs. Scaling a large fixed layout down can make text and controls too small and increases rendering work. On iOS, heavily scaled interfaces can contribute to WebKit crashes. Use responsive CSS or narrower layout variants where practical.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Below 490 pixels, player panels may no longer use a two-column mobile layout.&lt;br /&gt;
&lt;br /&gt;
Examples: &lt;br /&gt;
&lt;br /&gt;
* In &#039;&#039;&#039;Can&#039;t Stop&#039;&#039;&#039;, the dice are moved below the board on narrow screens:&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 990px) {&lt;br /&gt;
      #dicechoices {&lt;br /&gt;
          left: 180px;&lt;br /&gt;
          top: 530px;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      #cantstop_wrap {&lt;br /&gt;
          height: 900px;&lt;br /&gt;
          width: 550px;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
*In &#039;&#039;&#039;Seasons&#039;&#039;&#039;, panels normally displayed to the right of the board are moved below it:&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 970px) {&lt;br /&gt;
      #board {&lt;br /&gt;
          float: none;&lt;br /&gt;
          margin: auto;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      .seasons_rightpanel {&lt;br /&gt;
          margin-left: 0;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
On mobile, BGA moves player panels above the game and adds &amp;lt;code&amp;gt;mobile_version&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#ebd-body&amp;lt;/code&amp;gt;. The desktop layout uses &amp;lt;code&amp;gt;desktop_version&amp;lt;/code&amp;gt;. Use these classes for layout-specific CSS.&lt;br /&gt;
&lt;br /&gt;
===Autoscale===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;game_interface_width.autoscale&amp;lt;/code&amp;gt; controls what happens when the available width is smaller than &amp;lt;code&amp;gt;game_interface_width.min&amp;lt;/code&amp;gt;. It accepts &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt;. The default is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;code&amp;gt;autoscale: true&amp;lt;/code&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
BGA applies CSS &amp;lt;code&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/zoom zoom]&amp;lt;/code&amp;gt; to the game content.&lt;br /&gt;
&lt;br /&gt;
The game content scales independently from the surrounding BGA interface:&lt;br /&gt;
&lt;br /&gt;
*the top bar and tableview chat keep their normal size;&lt;br /&gt;
* the action bar and player panels use separate framework scaling on very narrow screens;&lt;br /&gt;
*standard BGA dialogs and tooltips generally keep their normal size;&lt;br /&gt;
*overlays inside the game area inherit the game zoom.&lt;br /&gt;
&lt;br /&gt;
This is the default mode and should suit most fixed-width games.&lt;br /&gt;
&lt;br /&gt;
=====Coordinates and animations=====&lt;br /&gt;
&lt;br /&gt;
Browsers do not return consistent geometry for elements using CSS zoom. For custom positioning inside the zoomed game area, use:&lt;br /&gt;
&lt;br /&gt;
  const rect = this.getBoundingClientRectIgnoreZoom(&amp;quot;my-element&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It returns logical, unscaled coordinates. BGA animation and positioning helpers already account for framework zoom.&lt;br /&gt;
&lt;br /&gt;
Use the native &amp;lt;code&amp;gt;getBoundingClientRect()&amp;lt;/code&amp;gt; when you need the visual position in the browser viewport, such as for an overlay outside the zoomed game area.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;code&amp;gt;autoscale: false&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
BGA does not scale the game area.&lt;br /&gt;
&lt;br /&gt;
{{Warn|1=&lt;br /&gt;
&#039;&#039;&#039;This mode is not recommended.&#039;&#039;&#039; Disable framework autoscaling only if the game already handles narrow screens itself, either through a fully responsive layout or a scaling system such as [[BgaZoom]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A fixed 740-pixel layout displayed in 390 pixels of available space will overflow horizontally and may require scrolling.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;code&amp;gt;autoscale: &amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
This mode presents the whole game through a wider logical viewport. The game area and the BGA interface around it are scaled together, preserving their relative sizes and layout.&lt;br /&gt;
&lt;br /&gt;
This option exists as a compatibility fallback. CSS &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; has behaved differently across browsers and has broken coordinate calculations or animations in some older games. Viewport scaling can keep those games working without rewriting their layout.&lt;br /&gt;
&lt;br /&gt;
It also has important drawbacks:&lt;br /&gt;
&lt;br /&gt;
*action bars, player panels, dialogs, and other game-page controls are scaled down with the game;&lt;br /&gt;
*text and controls can become very small;&lt;br /&gt;
*the layout does not adapt to the available space;&lt;br /&gt;
*scaling the entire game document is more expensive to render.&lt;br /&gt;
&lt;br /&gt;
{{Warn|1=&lt;br /&gt;
&#039;&#039;&#039;This mode is not recommended.&#039;&#039;&#039; Use it only as a compatibility fallback when CSS &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; causes a confirmed problem. Do not use viewport scaling as a shortcut for building a responsive interface.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Warn|1=&lt;br /&gt;
&#039;&#039;&#039;Legacy &amp;lt;code&amp;gt;default_viewport&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Some older games set the internal field &amp;lt;code&amp;gt;default_viewport&amp;lt;/code&amp;gt; directly:&lt;br /&gt;
&lt;br /&gt;
  this.default_viewport = &amp;quot;width=740&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This undocumented workaround predates the &amp;lt;code&amp;gt;autoscale&amp;lt;/code&amp;gt; option. It is still supported to avoid breaking published games, but now has the same effect as &amp;lt;code&amp;gt;autoscale: &amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt; and takes precedence over the configured mode.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not use it in new code.&#039;&#039;&#039; Existing games should test removing it and configure scaling through &amp;lt;code&amp;gt;game_interface_width&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Touchscreen compatibility ==&lt;br /&gt;
&lt;br /&gt;
BGA adds &amp;lt;code&amp;gt;touch-device&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#ebd-body&amp;lt;/code&amp;gt; when it detects a touchscreen, and &amp;lt;code&amp;gt;notouch-device&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CSS &amp;lt;code&amp;gt;:hover&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Touch devices have no persistent mouse cursor. Some emulate &amp;lt;code&amp;gt;:hover&amp;lt;/code&amp;gt; after a short touch, which can block the intended interaction. Prefix hover-only rules with &amp;lt;code&amp;gt;.notouch-device&amp;lt;/code&amp;gt; when they should not apply to touchscreens.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tooltips&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Do not make required information available only through hover. Provide a touch-accessible alternative.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mouse events&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Do not rely only on mouse-specific events such as &amp;lt;code&amp;gt;mouseover&amp;lt;/code&amp;gt;. Prefer the [https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events Pointer Events API], which supports mouse, touch, and pen input.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Drag and drop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Common approaches:&lt;br /&gt;
&lt;br /&gt;
*[https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events Pointer Events API]&lt;br /&gt;
**Example: https://codepen.io/VictoriaLa/pen/MWOgYYZ&lt;br /&gt;
**Game example: Century&lt;br /&gt;
&lt;br /&gt;
*[https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API Native HTML drag and drop]&lt;br /&gt;
**Example: https://codepen.io/VictoriaLa/pen/rNGXKxj&lt;br /&gt;
**Game example: Patchwork&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;touch-action: none&amp;lt;/code&amp;gt; only to elements where you handle touch or pointer gestures and need to suppress native scrolling or zooming.&lt;br /&gt;
&lt;br /&gt;
[[Category:Studio]]&lt;/div&gt;</summary>
		<author><name>BROT42</name></author>
	</entry>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=30860</id>
		<title>Your game mobile version</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=30860"/>
		<updated>2026-07-24T17:22:03Z</updated>

		<summary type="html">&lt;p&gt;BROT42: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Studio_Framework_Navigation}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Board Game Arena supports mobile phones and tablets. Most games are already playable on touch devices, but their layout and interactions still need to work on narrow screens.&lt;br /&gt;
&lt;br /&gt;
== Declare your interface minimum width ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;game_interface_width.min&amp;lt;/code&amp;gt; is the smallest logical width at which your game remains usable. The default is 740 pixels.&lt;br /&gt;
&lt;br /&gt;
When the available game area is at least this wide, the game is displayed at its normal scale. When it is narrower, &amp;lt;code&amp;gt;game_interface_width.autoscale&amp;lt;/code&amp;gt; determines how BGA handles the difference. With the default &amp;lt;code&amp;gt;autoscale: true&amp;lt;/code&amp;gt;, BGA scales the game content down to fit. For example, a minimum width of 740 pixels displayed in 390 pixels of available space is scaled to approximately 53%.&lt;br /&gt;
&lt;br /&gt;
Declare it in &#039;&#039;&#039;gameinfos.jsonc&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;game_interface_width&amp;quot;: {&lt;br /&gt;
      // Smallest usable width. Default: 740&lt;br /&gt;
      &amp;quot;min&amp;quot;: 540,&lt;br /&gt;
  &lt;br /&gt;
      // Default: true&lt;br /&gt;
      &amp;quot;autoscale&amp;quot;: true&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The declared width must actually work. If you declare 540 pixels, the complete interface must remain usable at 540 pixels.&lt;br /&gt;
&lt;br /&gt;
{{Info|1=&lt;br /&gt;
&#039;&#039;&#039;Autoscaling is not a substitute for adapting your interface to narrow screens.&#039;&#039;&#039; Keep &amp;lt;code&amp;gt;game_interface_width.min&amp;lt;/code&amp;gt; no larger than the interface genuinely needs. Scaling a large fixed layout down can make text and controls too small and increases rendering work. On iOS, heavily scaled interfaces can contribute to WebKit crashes. Use responsive CSS or narrower layout variants where practical.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Below 490 pixels, player panels may no longer use a two-column mobile layout.&lt;br /&gt;
&lt;br /&gt;
Examples: &lt;br /&gt;
&lt;br /&gt;
* In &#039;&#039;&#039;Can&#039;t Stop&#039;&#039;&#039;, the dice are moved below the board on narrow screens:&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 990px) {&lt;br /&gt;
      #dicechoices {&lt;br /&gt;
          left: 180px;&lt;br /&gt;
          top: 530px;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      #cantstop_wrap {&lt;br /&gt;
          height: 900px;&lt;br /&gt;
          width: 550px;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
*In &#039;&#039;&#039;Seasons&#039;&#039;&#039;, panels normally displayed to the right of the board are moved below it:&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 970px) {&lt;br /&gt;
      #board {&lt;br /&gt;
          float: none;&lt;br /&gt;
          margin: auto;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      .seasons_rightpanel {&lt;br /&gt;
          margin-left: 0;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
On mobile, BGA moves player panels above the game and adds &amp;lt;code&amp;gt;mobile_version&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#ebd-body&amp;lt;/code&amp;gt;. The desktop layout uses &amp;lt;code&amp;gt;desktop_version&amp;lt;/code&amp;gt;. Use these classes for layout-specific CSS.&lt;br /&gt;
&lt;br /&gt;
===Autoscale===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;game_interface_width.autoscale&amp;lt;/code&amp;gt; controls what happens when the available width is smaller than &amp;lt;code&amp;gt;game_interface_width.min&amp;lt;/code&amp;gt;. It accepts &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt;. The default is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The examples below use a 740-pixel game displayed in 390 pixels of available space.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;code&amp;gt;autoscale: true&amp;lt;/code&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
BGA applies CSS &amp;lt;code&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/zoom zoom]&amp;lt;/code&amp;gt; to the game content. In the example, the scale is approximately 53%.&lt;br /&gt;
&lt;br /&gt;
The game content scales independently from the surrounding BGA interface:&lt;br /&gt;
&lt;br /&gt;
*the top bar and tableview chat keep their normal size;&lt;br /&gt;
* the action bar and player panels use separate framework scaling on very narrow screens;&lt;br /&gt;
*standard BGA dialogs and tooltips generally keep their normal size;&lt;br /&gt;
*overlays inside the game area inherit the game zoom.&lt;br /&gt;
&lt;br /&gt;
This is the default mode and should suit most fixed-width games.&lt;br /&gt;
&lt;br /&gt;
=====Coordinates and animations=====&lt;br /&gt;
&lt;br /&gt;
Browsers do not return consistent geometry for elements using CSS zoom. For custom positioning inside the zoomed game area, use:&lt;br /&gt;
&lt;br /&gt;
  const rect = this.getBoundingClientRectIgnoreZoom(&amp;quot;my-element&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It returns logical, unscaled coordinates. BGA animation and positioning helpers already account for framework zoom.&lt;br /&gt;
&lt;br /&gt;
Use the native &amp;lt;code&amp;gt;getBoundingClientRect()&amp;lt;/code&amp;gt; when you need the visual position in the browser viewport, such as for an overlay outside the zoomed game area.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;code&amp;gt;autoscale: false&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
BGA does not scale the game area.&lt;br /&gt;
&lt;br /&gt;
{{Warn|1=&lt;br /&gt;
&#039;&#039;&#039;This mode is not recommended.&#039;&#039;&#039; Disable framework autoscaling only if the game already handles narrow screens itself, either through a fully responsive layout or a scaling system such as [[BgaZoom]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A fixed 740-pixel layout displayed in 390 pixels of available space will overflow horizontally and may require scrolling.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;code&amp;gt;autoscale: &amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
This mode presents the whole game through a wider logical viewport. The game area and the BGA interface around it are scaled together, preserving their relative sizes and layout.&lt;br /&gt;
&lt;br /&gt;
This option exists as a compatibility fallback. CSS &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; has behaved differently across browsers and has broken coordinate calculations or animations in some older games. Viewport scaling can keep those games working without rewriting their layout.&lt;br /&gt;
&lt;br /&gt;
It also has important drawbacks:&lt;br /&gt;
&lt;br /&gt;
*action bars, player panels, dialogs, and other game-page controls are scaled down with the game;&lt;br /&gt;
*text and controls can become very small;&lt;br /&gt;
*the layout does not adapt to the available space;&lt;br /&gt;
*scaling the entire game document is more expensive to render.&lt;br /&gt;
&lt;br /&gt;
{{Warn|1=&lt;br /&gt;
&#039;&#039;&#039;This mode is not recommended.&#039;&#039;&#039; Use it only as a compatibility fallback when CSS &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; causes a confirmed problem. Do not use viewport scaling as a shortcut for building a responsive interface.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Warn|1=&lt;br /&gt;
&#039;&#039;&#039;Legacy &amp;lt;code&amp;gt;default_viewport&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Some older games set the internal field &amp;lt;code&amp;gt;default_viewport&amp;lt;/code&amp;gt; directly:&lt;br /&gt;
&lt;br /&gt;
  this.default_viewport = &amp;quot;width=740&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This undocumented workaround predates the &amp;lt;code&amp;gt;autoscale&amp;lt;/code&amp;gt; option. It is still supported to avoid breaking published games, but now has the same effect as &amp;lt;code&amp;gt;autoscale: &amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt; and takes precedence over the configured mode.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not use it in new code.&#039;&#039;&#039; Existing games should test removing it and configure scaling through &amp;lt;code&amp;gt;game_interface_width&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Touchscreen compatibility ==&lt;br /&gt;
&lt;br /&gt;
BGA adds &amp;lt;code&amp;gt;touch-device&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#ebd-body&amp;lt;/code&amp;gt; when it detects a touchscreen, and &amp;lt;code&amp;gt;notouch-device&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CSS &amp;lt;code&amp;gt;:hover&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Touch devices have no persistent mouse cursor. Some emulate &amp;lt;code&amp;gt;:hover&amp;lt;/code&amp;gt; after a short touch, which can block the intended interaction. Prefix hover-only rules with &amp;lt;code&amp;gt;.notouch-device&amp;lt;/code&amp;gt; when they should not apply to touchscreens.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tooltips&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Do not make required information available only through hover. Provide a touch-accessible alternative.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mouse events&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Do not rely only on mouse-specific events such as &amp;lt;code&amp;gt;mouseover&amp;lt;/code&amp;gt;. Prefer the [https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events Pointer Events API], which supports mouse, touch, and pen input.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Drag and drop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Common approaches:&lt;br /&gt;
&lt;br /&gt;
*[https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events Pointer Events API]&lt;br /&gt;
**Example: https://codepen.io/VictoriaLa/pen/MWOgYYZ&lt;br /&gt;
**Game example: Century&lt;br /&gt;
&lt;br /&gt;
*[https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API Native HTML drag and drop]&lt;br /&gt;
**Example: https://codepen.io/VictoriaLa/pen/rNGXKxj&lt;br /&gt;
**Game example: Patchwork&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;touch-action: none&amp;lt;/code&amp;gt; only to elements where you handle touch or pointer gestures and need to suppress native scrolling or zooming.&lt;br /&gt;
&lt;br /&gt;
[[Category:Studio]]&lt;/div&gt;</summary>
		<author><name>BROT42</name></author>
	</entry>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=30859</id>
		<title>Your game mobile version</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=30859"/>
		<updated>2026-07-24T17:12:43Z</updated>

		<summary type="html">&lt;p&gt;BROT42: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Studio_Framework_Navigation}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Board Game Arena supports mobile phones and tablets. Most games are already playable on touch devices, but their layout and interactions still need to work on narrow screens.&lt;br /&gt;
&lt;br /&gt;
== Declare your interface minimum width ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;game_interface_width.min&amp;lt;/code&amp;gt; is the smallest logical width at which your game remains usable. The default is 740 pixels.&lt;br /&gt;
&lt;br /&gt;
Declare it in &#039;&#039;&#039;gameinfos.jsonc&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;game_interface_width&amp;quot;: {&lt;br /&gt;
      // Smallest usable width. Default: 740&lt;br /&gt;
      &amp;quot;min&amp;quot;: 540,&lt;br /&gt;
  &lt;br /&gt;
      // Default: true&lt;br /&gt;
      &amp;quot;autoscale&amp;quot;: true&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The declared width must actually work. If you declare 540 pixels, the complete interface must remain usable at 540 pixels.&lt;br /&gt;
&lt;br /&gt;
{{Info|1=&lt;br /&gt;
&#039;&#039;&#039;Autoscaling is not a substitute for adapting your interface to narrow screens.&#039;&#039;&#039; Keep &amp;lt;code&amp;gt;game_interface_width.min&amp;lt;/code&amp;gt; no larger than the interface genuinely needs. Scaling a large fixed layout down can make text and controls too small and increases rendering work. On iOS, heavily scaled interfaces can contribute to WebKit crashes. Use responsive CSS or narrower layout variants where practical.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Below 490 pixels, player panels may no longer use a two-column mobile layout.&lt;br /&gt;
&lt;br /&gt;
Examples: &lt;br /&gt;
&lt;br /&gt;
* In &#039;&#039;&#039;Can&#039;t Stop&#039;&#039;&#039;, the dice are moved below the board on narrow screens:&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 990px) {&lt;br /&gt;
      #dicechoices {&lt;br /&gt;
          left: 180px;&lt;br /&gt;
          top: 530px;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      #cantstop_wrap {&lt;br /&gt;
          height: 900px;&lt;br /&gt;
          width: 550px;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
*In &#039;&#039;&#039;Seasons&#039;&#039;&#039;, panels normally displayed to the right of the board are moved below it:&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 970px) {&lt;br /&gt;
      #board {&lt;br /&gt;
          float: none;&lt;br /&gt;
          margin: auto;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      .seasons_rightpanel {&lt;br /&gt;
          margin-left: 0;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
On mobile, BGA moves player panels above the game and adds &amp;lt;code&amp;gt;mobile_version&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#ebd-body&amp;lt;/code&amp;gt;. The desktop layout uses &amp;lt;code&amp;gt;desktop_version&amp;lt;/code&amp;gt;. Use these classes for layout-specific CSS.&lt;br /&gt;
&lt;br /&gt;
===Autoscale===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;game_interface_width.autoscale&amp;lt;/code&amp;gt; controls what happens when the available width is smaller than &amp;lt;code&amp;gt;game_interface_width.min&amp;lt;/code&amp;gt;. It accepts &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt;. The default is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The examples below use a 740-pixel game displayed in 390 pixels of available space.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;code&amp;gt;autoscale: true&amp;lt;/code&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
BGA applies CSS &amp;lt;code&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/zoom zoom]&amp;lt;/code&amp;gt; to the game content. In the example, the scale is approximately 53%.&lt;br /&gt;
&lt;br /&gt;
The game content scales independently from the surrounding BGA interface:&lt;br /&gt;
&lt;br /&gt;
*the top bar and tableview chat keep their normal size;&lt;br /&gt;
* the action bar and player panels use separate framework scaling on very narrow screens;&lt;br /&gt;
*standard BGA dialogs and tooltips generally keep their normal size;&lt;br /&gt;
*overlays inside the game area inherit the game zoom.&lt;br /&gt;
&lt;br /&gt;
This is the default mode and should suit most fixed-width games.&lt;br /&gt;
&lt;br /&gt;
=====Coordinates and animations=====&lt;br /&gt;
&lt;br /&gt;
Browsers do not return consistent geometry for elements using CSS zoom. For custom positioning inside the zoomed game area, use:&lt;br /&gt;
&lt;br /&gt;
  const rect = this.getBoundingClientRectIgnoreZoom(&amp;quot;my-element&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It returns logical, unscaled coordinates. BGA animation and positioning helpers already account for framework zoom.&lt;br /&gt;
&lt;br /&gt;
Use the native &amp;lt;code&amp;gt;getBoundingClientRect()&amp;lt;/code&amp;gt; when you need the visual position in the browser viewport, such as for an overlay outside the zoomed game area.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;code&amp;gt;autoscale: false&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
BGA does not scale the game area.&lt;br /&gt;
&lt;br /&gt;
{{Warn|1=&lt;br /&gt;
&#039;&#039;&#039;This mode is not recommended.&#039;&#039;&#039; Disable framework autoscaling only if the game already handles narrow screens itself, either through a fully responsive layout or a scaling system such as [[BgaZoom]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A fixed 740-pixel layout displayed in 390 pixels of available space will overflow horizontally and may require scrolling.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;code&amp;gt;autoscale: &amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
This mode presents the whole game through a wider logical viewport. The game area and the BGA interface around it are scaled together, preserving their relative sizes and layout.&lt;br /&gt;
&lt;br /&gt;
This option exists as a compatibility fallback. CSS &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; has behaved differently across browsers and has broken coordinate calculations or animations in some older games. Viewport scaling can keep those games working without rewriting their layout.&lt;br /&gt;
&lt;br /&gt;
It also has important drawbacks:&lt;br /&gt;
&lt;br /&gt;
*action bars, player panels, dialogs, and other game-page controls are scaled down with the game;&lt;br /&gt;
*text and controls can become very small;&lt;br /&gt;
*the layout does not adapt to the available space;&lt;br /&gt;
*scaling the entire game document is more expensive to render.&lt;br /&gt;
&lt;br /&gt;
{{Warn|1=&lt;br /&gt;
&#039;&#039;&#039;This mode is not recommended.&#039;&#039;&#039; Use it only as a compatibility fallback when CSS &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; causes a confirmed problem. Do not use viewport scaling as a shortcut for building a responsive interface.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Warn|1=&lt;br /&gt;
&#039;&#039;&#039;Legacy &amp;lt;code&amp;gt;default_viewport&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Some older games set the internal field &amp;lt;code&amp;gt;default_viewport&amp;lt;/code&amp;gt; directly:&lt;br /&gt;
&lt;br /&gt;
  this.default_viewport = &amp;quot;width=740&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This undocumented workaround predates the &amp;lt;code&amp;gt;autoscale&amp;lt;/code&amp;gt; option. It is still supported to avoid breaking published games, but now has the same effect as &amp;lt;code&amp;gt;autoscale: &amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt; and takes precedence over the configured mode.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not use it in new code.&#039;&#039;&#039; Existing games should test removing it and configure scaling through &amp;lt;code&amp;gt;game_interface_width&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Touchscreen compatibility ==&lt;br /&gt;
&lt;br /&gt;
BGA adds &amp;lt;code&amp;gt;touch-device&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#ebd-body&amp;lt;/code&amp;gt; when it detects a touchscreen, and &amp;lt;code&amp;gt;notouch-device&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CSS &amp;lt;code&amp;gt;:hover&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Touch devices have no persistent mouse cursor. Some emulate &amp;lt;code&amp;gt;:hover&amp;lt;/code&amp;gt; after a short touch, which can block the intended interaction. Prefix hover-only rules with &amp;lt;code&amp;gt;.notouch-device&amp;lt;/code&amp;gt; when they should not apply to touchscreens.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tooltips&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Do not make required information available only through hover. Provide a touch-accessible alternative.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mouse events&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Do not rely only on mouse-specific events such as &amp;lt;code&amp;gt;mouseover&amp;lt;/code&amp;gt;. Prefer the [https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events Pointer Events API], which supports mouse, touch, and pen input.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Drag and drop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Common approaches:&lt;br /&gt;
&lt;br /&gt;
*[https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events Pointer Events API]&lt;br /&gt;
**Example: https://codepen.io/VictoriaLa/pen/MWOgYYZ&lt;br /&gt;
**Game example: Century&lt;br /&gt;
&lt;br /&gt;
*[https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API Native HTML drag and drop]&lt;br /&gt;
**Example: https://codepen.io/VictoriaLa/pen/rNGXKxj&lt;br /&gt;
**Game example: Patchwork&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;touch-action: none&amp;lt;/code&amp;gt; only to elements where you handle touch or pointer gestures and need to suppress native scrolling or zooming.&lt;br /&gt;
&lt;br /&gt;
[[Category:Studio]]&lt;/div&gt;</summary>
		<author><name>BROT42</name></author>
	</entry>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=30858</id>
		<title>Your game mobile version</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=30858"/>
		<updated>2026-07-24T16:38:40Z</updated>

		<summary type="html">&lt;p&gt;BROT42: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Studio_Framework_Navigation}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Board Game Arena supports mobile phones and tablets. Most games are already playable on touch devices, but their layout and interactions still need to work on narrow screens.&lt;br /&gt;
&lt;br /&gt;
== Declare your interface minimum width ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;game_interface_width.min&amp;lt;/code&amp;gt; is the smallest logical width at which your game remains usable. The default is 740 pixels.&lt;br /&gt;
&lt;br /&gt;
Declare it in &#039;&#039;&#039;gameinfos.jsonc&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;game_interface_width&amp;quot;: {&lt;br /&gt;
      // Smallest usable width. Default: 740&lt;br /&gt;
      &amp;quot;min&amp;quot;: 540,&lt;br /&gt;
  &lt;br /&gt;
      // Default: true&lt;br /&gt;
      &amp;quot;autoscale&amp;quot;: true&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The declared width must actually work. If you declare 540 pixels, the complete interface must remain usable at 540 pixels.&lt;br /&gt;
&lt;br /&gt;
Keep the minimum as low as reasonably possible. Large values require stronger scaling on phones, make content smaller, and increase rendering work. Use fluid layouts and CSS media queries instead of declaring a large fixed width.&lt;br /&gt;
&lt;br /&gt;
Below 490 pixels, player panels may no longer use a two-column mobile layout.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
* In &#039;&#039;&#039;Can&#039;t Stop&#039;&#039;&#039;, the dice are moved below the board on narrow screens:&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 990px) {&lt;br /&gt;
      #dicechoices {&lt;br /&gt;
          left: 180px;&lt;br /&gt;
          top: 530px;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      #cantstop_wrap {&lt;br /&gt;
          height: 900px;&lt;br /&gt;
          width: 550px;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* In &#039;&#039;&#039;Seasons&#039;&#039;&#039;, panels normally displayed to the right of the board are moved below it:&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 970px) {&lt;br /&gt;
      #board {&lt;br /&gt;
          float: none;&lt;br /&gt;
          margin: auto;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      .seasons_rightpanel {&lt;br /&gt;
          margin-left: 0;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
On mobile, BGA moves player panels above the game and adds &amp;lt;code&amp;gt;mobile_version&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#ebd-body&amp;lt;/code&amp;gt;. The desktop layout uses &amp;lt;code&amp;gt;desktop_version&amp;lt;/code&amp;gt;. Use these classes for layout-specific CSS.&lt;br /&gt;
&lt;br /&gt;
=== Autoscale ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;game_interface_width.autoscale&amp;lt;/code&amp;gt; controls what happens when the available width is smaller than &amp;lt;code&amp;gt;game_interface_width.min&amp;lt;/code&amp;gt;. It accepts &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt;. The default is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The examples below use a 740-pixel game displayed in 390 pixels of available space.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;autoscale: true&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
BGA applies CSS &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; to the game content. In the example, the scale is approximately 53%.&lt;br /&gt;
&lt;br /&gt;
The game content scales independently from the surrounding BGA interface:&lt;br /&gt;
&lt;br /&gt;
* the top bar and tableview chat keep their normal size;&lt;br /&gt;
* the action bar and player panels use separate framework scaling on very narrow screens;&lt;br /&gt;
* standard BGA dialogs and tooltips generally keep their normal size;&lt;br /&gt;
* overlays inside the game area inherit the game zoom.&lt;br /&gt;
&lt;br /&gt;
This is the default mode and should suit most fixed-width games.&lt;br /&gt;
&lt;br /&gt;
===== Coordinates and animations =====&lt;br /&gt;
&lt;br /&gt;
Browsers do not return consistent geometry for elements using CSS zoom. For custom positioning inside the zoomed game area, use:&lt;br /&gt;
&lt;br /&gt;
  const rect = this.getBoundingClientRectIgnoreZoom(&amp;quot;my-element&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It returns logical, unscaled coordinates. BGA animation and positioning helpers already account for framework zoom.&lt;br /&gt;
&lt;br /&gt;
Use the native &amp;lt;code&amp;gt;getBoundingClientRect()&amp;lt;/code&amp;gt; when you need the visual position in the browser viewport, such as for an overlay outside the zoomed game area.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;autoscale: false&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
BGA does not scale the game area.&lt;br /&gt;
&lt;br /&gt;
{{Warn|1=&lt;br /&gt;
&#039;&#039;&#039;This mode is not recommended.&#039;&#039;&#039; Disable framework autoscaling only if the game already handles narrow screens itself, either through a fully responsive layout or a scaling system such as [[BgaZoom]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A fixed 740-pixel layout displayed in 390 pixels of available space will overflow horizontally and may require scrolling.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;autoscale: &amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
This mode presents the whole game through a wider logical viewport. The game area and the BGA interface around it are scaled together, preserving their relative sizes and layout.&lt;br /&gt;
&lt;br /&gt;
This option exists as a compatibility fallback. CSS &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; has behaved differently across browsers and has broken coordinate calculations or animations in some older games. Viewport scaling can keep those games working without rewriting their layout.&lt;br /&gt;
&lt;br /&gt;
It also has important drawbacks:&lt;br /&gt;
&lt;br /&gt;
* action bars, player panels, dialogs, and other game-page controls are scaled down with the game;&lt;br /&gt;
* text and controls can become very small;&lt;br /&gt;
* the layout does not adapt to the available space;&lt;br /&gt;
* scaling the entire game document is more expensive to render.&lt;br /&gt;
&lt;br /&gt;
{{Warn|1=&lt;br /&gt;
&#039;&#039;&#039;This mode is not recommended.&#039;&#039;&#039; Use it only as a compatibility fallback when CSS &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; causes a confirmed problem. Do not use viewport scaling as a shortcut for building a responsive interface.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Warn|1=&lt;br /&gt;
&#039;&#039;&#039;Legacy &amp;lt;code&amp;gt;default_viewport&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Some older games set the internal field &amp;lt;code&amp;gt;default_viewport&amp;lt;/code&amp;gt; directly:&lt;br /&gt;
&lt;br /&gt;
  this.default_viewport = &amp;quot;width=740&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This undocumented workaround predates the &amp;lt;code&amp;gt;autoscale&amp;lt;/code&amp;gt; option. It is still supported to avoid breaking published games, but now has the same effect as &amp;lt;code&amp;gt;autoscale: &amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt; and takes precedence over the configured mode.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not use it in new code.&#039;&#039;&#039; Existing games should test removing it and configure scaling through &amp;lt;code&amp;gt;game_interface_width&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Touchscreen compatibility ==&lt;br /&gt;
&lt;br /&gt;
BGA adds &amp;lt;code&amp;gt;touch-device&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#ebd-body&amp;lt;/code&amp;gt; when it detects a touchscreen, and &amp;lt;code&amp;gt;notouch-device&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CSS &amp;lt;code&amp;gt;:hover&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Touch devices have no persistent mouse cursor. Some emulate &amp;lt;code&amp;gt;:hover&amp;lt;/code&amp;gt; after a short touch, which can block the intended interaction. Prefix hover-only rules with &amp;lt;code&amp;gt;.notouch-device&amp;lt;/code&amp;gt; when they should not apply to touchscreens.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tooltips&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Do not make required information available only through hover. Provide a touch-accessible alternative.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mouse events&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Do not rely only on mouse-specific events such as &amp;lt;code&amp;gt;mouseover&amp;lt;/code&amp;gt;. Prefer the [https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events Pointer Events API], which supports mouse, touch, and pen input.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Drag and drop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Common approaches:&lt;br /&gt;
&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events Pointer Events API]&lt;br /&gt;
** Example: https://codepen.io/VictoriaLa/pen/MWOgYYZ&lt;br /&gt;
** Game example: Century&lt;br /&gt;
&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API Native HTML drag and drop]&lt;br /&gt;
** Example: https://codepen.io/VictoriaLa/pen/rNGXKxj&lt;br /&gt;
** Game example: Patchwork&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;touch-action: none&amp;lt;/code&amp;gt; only to elements where you handle touch or pointer gestures and need to suppress native scrolling or zooming.&lt;br /&gt;
&lt;br /&gt;
[[Category:Studio]]&lt;/div&gt;</summary>
		<author><name>BROT42</name></author>
	</entry>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=30800</id>
		<title>Your game mobile version</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=30800"/>
		<updated>2026-07-23T14:54:34Z</updated>

		<summary type="html">&lt;p&gt;BROT42: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Studio_Framework_Navigation}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Board Game Arena supports mobile phones and tablets. Most games are already playable on touch devices, but their layout and interactions still need to work on narrow screens.&lt;br /&gt;
&lt;br /&gt;
== Declare your interface minimum width ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;game_interface_width.min&amp;lt;/code&amp;gt; is the smallest logical width at which your game remains usable. The default is 740 pixels.&lt;br /&gt;
&lt;br /&gt;
Declare it in &#039;&#039;&#039;gameinfos.jsonc&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;game_interface_width&amp;quot;: {&lt;br /&gt;
      // Smallest usable width. Default: 740&lt;br /&gt;
      &amp;quot;min&amp;quot;: 540,&lt;br /&gt;
  &lt;br /&gt;
      // Default: true&lt;br /&gt;
      &amp;quot;autoscale&amp;quot;: true&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The declared width must actually work. If you declare 540 pixels, the complete interface must remain usable at 540 pixels.&lt;br /&gt;
&lt;br /&gt;
Keep the minimum as low as reasonably possible. Large values require stronger scaling on phones, make content smaller, and increase rendering work. Use fluid layouts and CSS media queries instead of declaring a large fixed width.&lt;br /&gt;
&lt;br /&gt;
Below 490 pixels, player panels may no longer use a two-column mobile layout.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
* In &#039;&#039;&#039;Can&#039;t Stop&#039;&#039;&#039;, the dice are moved below the board on narrow screens:&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 990px) {&lt;br /&gt;
      #dicechoices {&lt;br /&gt;
          left: 180px;&lt;br /&gt;
          top: 530px;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      #cantstop_wrap {&lt;br /&gt;
          height: 900px;&lt;br /&gt;
          width: 550px;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* In &#039;&#039;&#039;Seasons&#039;&#039;&#039;, panels normally displayed to the right of the board are moved below it:&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 970px) {&lt;br /&gt;
      #board {&lt;br /&gt;
          float: none;&lt;br /&gt;
          margin: auto;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      .seasons_rightpanel {&lt;br /&gt;
          margin-left: 0;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
On mobile, BGA moves player panels above the game and adds &amp;lt;code&amp;gt;mobile_version&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#ebd-body&amp;lt;/code&amp;gt;. The desktop layout uses &amp;lt;code&amp;gt;desktop_version&amp;lt;/code&amp;gt;. Use these classes for layout-specific CSS.&lt;br /&gt;
&lt;br /&gt;
=== Autoscale ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;game_interface_width.autoscale&amp;lt;/code&amp;gt; controls what happens when the available width is smaller than &amp;lt;code&amp;gt;game_interface_width.min&amp;lt;/code&amp;gt;. It accepts &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt;. The default is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The examples below use a 740-pixel game displayed in 390 pixels of available space.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;autoscale: true&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
BGA applies CSS &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; to the game content. In the example, the scale is approximately 53%.&lt;br /&gt;
&lt;br /&gt;
The game content scales independently from the surrounding BGA interface:&lt;br /&gt;
&lt;br /&gt;
* the top bar and tableview chat keep their normal size;&lt;br /&gt;
* the action bar and player panels use separate framework scaling on very narrow screens;&lt;br /&gt;
* standard BGA dialogs and tooltips generally keep their normal size;&lt;br /&gt;
* overlays inside the game area inherit the game zoom.&lt;br /&gt;
&lt;br /&gt;
This is the default mode and should suit most fixed-width games.&lt;br /&gt;
&lt;br /&gt;
===== Coordinates and animations =====&lt;br /&gt;
&lt;br /&gt;
Browsers do not return consistent geometry for elements using CSS zoom. For custom positioning inside the zoomed game area, use:&lt;br /&gt;
&lt;br /&gt;
  const rect = this.getBoundingClientRectIgnoreZoom(&amp;quot;my-element&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It returns logical, unscaled coordinates. BGA animation and positioning helpers already account for framework zoom.&lt;br /&gt;
&lt;br /&gt;
Use the native &amp;lt;code&amp;gt;getBoundingClientRect()&amp;lt;/code&amp;gt; when you need the visual position in the browser viewport, such as for an overlay outside the zoomed game area.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;autoscale: false&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
BGA does not scale the game area.&lt;br /&gt;
&lt;br /&gt;
Use this for responsive games or games with their own scaling system, such as [[BgaZoom]]. A fixed 740-pixel layout displayed in 390 pixels will otherwise overflow horizontally and may require scrolling.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;autoscale: &amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
This mode presents the whole game through a wider logical viewport. The game area and the BGA interface around it are scaled together, preserving their relative sizes and layout.&lt;br /&gt;
&lt;br /&gt;
This option exists as a compatibility fallback. CSS &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; has behaved differently across browsers and has broken coordinate calculations or animations in some older games. Viewport scaling can keep those games working without rewriting their layout.&lt;br /&gt;
&lt;br /&gt;
It also has important drawbacks:&lt;br /&gt;
&lt;br /&gt;
* action bars, player panels, dialogs, and other game-page controls are scaled down with the game;&lt;br /&gt;
* text and controls can become very small;&lt;br /&gt;
* the layout does not adapt to the available space;&lt;br /&gt;
* scaling the entire game document is more expensive to render.&lt;br /&gt;
&lt;br /&gt;
Do not use viewport scaling as a shortcut for building a responsive interface. Prefer &amp;lt;code&amp;gt;autoscale: true&amp;lt;/code&amp;gt; or responsive CSS unless the game has a confirmed compatibility problem with CSS zoom.&lt;br /&gt;
&lt;br /&gt;
{{Warn|1=&lt;br /&gt;
&#039;&#039;&#039;Legacy &amp;lt;code&amp;gt;default_viewport&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Some older games set the internal field &amp;lt;code&amp;gt;default_viewport&amp;lt;/code&amp;gt; directly:&lt;br /&gt;
&lt;br /&gt;
  this.default_viewport = &amp;quot;width=740&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
This undocumented workaround predates the &amp;lt;code&amp;gt;autoscale&amp;lt;/code&amp;gt; option. It is still supported to avoid breaking published games, but now has the same effect as &amp;lt;code&amp;gt;autoscale: &amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt; and takes precedence over the configured mode.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not use it in new code.&#039;&#039;&#039; Existing games should test removing it and configure scaling through &amp;lt;code&amp;gt;game_interface_width&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Touchscreen compatibility ==&lt;br /&gt;
&lt;br /&gt;
BGA adds &amp;lt;code&amp;gt;touch-device&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#ebd-body&amp;lt;/code&amp;gt; when it detects a touchscreen, and &amp;lt;code&amp;gt;notouch-device&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CSS &amp;lt;code&amp;gt;:hover&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Touch devices have no persistent mouse cursor. Some emulate &amp;lt;code&amp;gt;:hover&amp;lt;/code&amp;gt; after a short touch, which can block the intended interaction. Prefix hover-only rules with &amp;lt;code&amp;gt;.notouch-device&amp;lt;/code&amp;gt; when they should not apply to touchscreens.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tooltips&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Do not make required information available only through hover. Provide a touch-accessible alternative.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mouse events&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Do not rely only on mouse-specific events such as &amp;lt;code&amp;gt;mouseover&amp;lt;/code&amp;gt;. Prefer the [https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events Pointer Events API], which supports mouse, touch, and pen input.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Drag and drop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Common approaches:&lt;br /&gt;
&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events Pointer Events API]&lt;br /&gt;
** Example: https://codepen.io/VictoriaLa/pen/MWOgYYZ&lt;br /&gt;
** Game example: Century&lt;br /&gt;
&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API Native HTML drag and drop]&lt;br /&gt;
** Example: https://codepen.io/VictoriaLa/pen/rNGXKxj&lt;br /&gt;
** Game example: Patchwork&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;touch-action: none&amp;lt;/code&amp;gt; only to elements where you handle touch or pointer gestures and need to suppress native scrolling or zooming.&lt;br /&gt;
&lt;br /&gt;
[[Category:Studio]]&lt;/div&gt;</summary>
		<author><name>BROT42</name></author>
	</entry>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=30799</id>
		<title>Your game mobile version</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=30799"/>
		<updated>2026-07-23T14:49:14Z</updated>

		<summary type="html">&lt;p&gt;BROT42: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Studio_Framework_Navigation}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Board Game Arena supports mobile phones and tablets. Most games are already playable on touch devices, but their layout and interactions still need to work on narrow screens.&lt;br /&gt;
&lt;br /&gt;
== Declare your interface minimum width ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;game_interface_width.min&amp;lt;/code&amp;gt; is the smallest logical width at which your game remains usable. The default is 740 pixels.&lt;br /&gt;
&lt;br /&gt;
Declare it in &#039;&#039;&#039;gameinfos.jsonc&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;game_interface_width&amp;quot;: {&lt;br /&gt;
      // Smallest usable width. Default: 740&lt;br /&gt;
      &amp;quot;min&amp;quot;: 540,&lt;br /&gt;
  &lt;br /&gt;
      // Default: true&lt;br /&gt;
      &amp;quot;autoscale&amp;quot;: true&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The declared width must actually work. If you declare 540 pixels, the complete interface must remain usable at 540 pixels.&lt;br /&gt;
&lt;br /&gt;
Keep the minimum as low as reasonably possible. Large values require stronger scaling on phones, make content smaller, and increase rendering work. Use fluid layouts and CSS media queries instead of declaring a large fixed width.&lt;br /&gt;
&lt;br /&gt;
Below 490 pixels, player panels may no longer use a two-column mobile layout.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
* In &#039;&#039;&#039;Can&#039;t Stop&#039;&#039;&#039;, the dice are moved below the board on narrow screens:&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 990px) {&lt;br /&gt;
      #dicechoices {&lt;br /&gt;
          left: 180px;&lt;br /&gt;
          top: 530px;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      #cantstop_wrap {&lt;br /&gt;
          height: 900px;&lt;br /&gt;
          width: 550px;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* In &#039;&#039;&#039;Seasons&#039;&#039;&#039;, panels normally displayed to the right of the board are moved below it:&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 970px) {&lt;br /&gt;
      #board {&lt;br /&gt;
          float: none;&lt;br /&gt;
          margin: auto;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      .seasons_rightpanel {&lt;br /&gt;
          margin-left: 0;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
On mobile, BGA moves player panels above the game and adds &amp;lt;code&amp;gt;mobile_version&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#ebd-body&amp;lt;/code&amp;gt;. The desktop layout uses &amp;lt;code&amp;gt;desktop_version&amp;lt;/code&amp;gt;. Use these classes for layout-specific CSS.&lt;br /&gt;
&lt;br /&gt;
=== Autoscale ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;game_interface_width.autoscale&amp;lt;/code&amp;gt; controls what happens when the available width is smaller than &amp;lt;code&amp;gt;min&amp;lt;/code&amp;gt;. It accepts &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt;. The default is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The examples below use a 740-pixel game displayed in 390 pixels of available space.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;autoscale: true&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
BGA applies CSS &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; to the game content. In the example, the scale is approximately 53%.&lt;br /&gt;
&lt;br /&gt;
The game content scales independently from the surrounding BGA interface:&lt;br /&gt;
&lt;br /&gt;
* the top bar and tableview chat keep their normal size;&lt;br /&gt;
* the action bar and player panels use separate framework scaling on very narrow screens;&lt;br /&gt;
* standard BGA dialogs and tooltips generally keep their normal size;&lt;br /&gt;
* overlays inside the game area inherit the game zoom.&lt;br /&gt;
&lt;br /&gt;
This is the default mode and should suit most fixed-width games.&lt;br /&gt;
&lt;br /&gt;
===== Coordinates and animations =====&lt;br /&gt;
&lt;br /&gt;
Browsers do not return consistent geometry for elements using CSS zoom. For custom positioning inside the zoomed game area, use:&lt;br /&gt;
&lt;br /&gt;
  const rect = this.getBoundingClientRectIgnoreZoom(&amp;quot;my-element&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It returns logical, unscaled coordinates. BGA animation and positioning helpers already account for framework zoom.&lt;br /&gt;
&lt;br /&gt;
Use the native &amp;lt;code&amp;gt;getBoundingClientRect()&amp;lt;/code&amp;gt; when you need the visual position in the browser viewport, such as for an overlay outside the zoomed game area.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;autoscale: false&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
BGA does not scale the game area.&lt;br /&gt;
&lt;br /&gt;
Use this for responsive games or games with their own scaling system, such as [[BgaZoom]]. A fixed 740-pixel layout displayed in 390 pixels will otherwise overflow horizontally and may require scrolling.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;autoscale: &amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
This mode scales the whole game document through a wider logical viewport.&lt;br /&gt;
&lt;br /&gt;
Previously, when game pages were opened directly, BGA set the document viewport width and let the mobile browser fit it to the screen.&lt;br /&gt;
&lt;br /&gt;
Games are now normally opened through &amp;lt;code&amp;gt;/tableview&amp;lt;/code&amp;gt;. The game runs in an iframe, and its viewport cannot resize that iframe. Tableview emulates the same result by laying out the iframe at the requested width and applying &amp;lt;code&amp;gt;transform: scale(...)&amp;lt;/code&amp;gt; to it.&lt;br /&gt;
&lt;br /&gt;
In the example, the iframe is laid out at 740 pixels and displayed at approximately 53% scale. The game area and the BGA controls inside the iframe are scaled together.&lt;br /&gt;
&lt;br /&gt;
CSS &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; participates in layout. &amp;lt;code&amp;gt;transform: scale(...)&amp;lt;/code&amp;gt; scales after layout and usually creates a composited layer. Transforming a large iframe can be expensive on mobile devices.&lt;br /&gt;
&lt;br /&gt;
Prefer &amp;lt;code&amp;gt;autoscale: true&amp;lt;/code&amp;gt; or a responsive layout unless viewport scaling is required for compatibility.&lt;br /&gt;
&lt;br /&gt;
{{Warn|1=&lt;br /&gt;
&#039;&#039;&#039;Legacy &amp;lt;code&amp;gt;default_viewport&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Some older games contain code such as:&lt;br /&gt;
&lt;br /&gt;
  this.default_viewport = &amp;quot;width=740&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;default_viewport&amp;lt;/code&amp;gt; started as internal framework state. Games later used it as an undocumented viewport override before &amp;lt;code&amp;gt;game_interface_width.autoscale&amp;lt;/code&amp;gt; existed.&lt;br /&gt;
&lt;br /&gt;
It remains supported to avoid breaking published games. In tableview, it enables the same iframe scaling as &amp;lt;code&amp;gt;autoscale: &amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt; and takes precedence over the configured autoscaling mode.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not use it in new code.&#039;&#039;&#039; Existing games should test removing it and use &amp;lt;code&amp;gt;game_interface_width&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Warn|1=&lt;br /&gt;
&#039;&#039;&#039;Mobile rendering performance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Large transformed interfaces can crash iOS browsers during pinch zoom. See [https://boardgamearena.com/bug?id=229359 BGA bug #229359] and [https://bugs.webkit.org/show_bug.cgi?id=172206 WebKit bug #172206].&lt;br /&gt;
&lt;br /&gt;
Reduce the risk:&lt;br /&gt;
&lt;br /&gt;
* keep interface dimensions reasonable;&lt;br /&gt;
* reduce image pixel dimensions and file sizes;&lt;br /&gt;
* avoid unnecessarily large sprite sheets;&lt;br /&gt;
* limit large fixed or transformed elements;&lt;br /&gt;
* avoid unnecessary animation, canvas, and WebGL rendering.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Touchscreen compatibility ==&lt;br /&gt;
&lt;br /&gt;
BGA adds &amp;lt;code&amp;gt;touch-device&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#ebd-body&amp;lt;/code&amp;gt; when it detects a touchscreen, and &amp;lt;code&amp;gt;notouch-device&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CSS &amp;lt;code&amp;gt;:hover&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Touch devices have no persistent mouse cursor. Some emulate &amp;lt;code&amp;gt;:hover&amp;lt;/code&amp;gt; after a short touch, which can block the intended interaction. Prefix hover-only rules with &amp;lt;code&amp;gt;.notouch-device&amp;lt;/code&amp;gt; when they should not apply to touchscreens.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tooltips&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Do not make required information available only through hover. Provide a touch-accessible alternative.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mouse events&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Do not rely only on mouse-specific events such as &amp;lt;code&amp;gt;mouseover&amp;lt;/code&amp;gt;. Prefer the [https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events Pointer Events API], which supports mouse, touch, and pen input.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Drag and drop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Common approaches:&lt;br /&gt;
&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events Pointer Events API]&lt;br /&gt;
** Example: https://codepen.io/VictoriaLa/pen/MWOgYYZ&lt;br /&gt;
** Game example: Century&lt;br /&gt;
&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API Native HTML drag and drop]&lt;br /&gt;
** Example: https://codepen.io/VictoriaLa/pen/rNGXKxj&lt;br /&gt;
** Game example: Patchwork&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;touch-action: none&amp;lt;/code&amp;gt; only to elements where you handle touch or pointer gestures and need to suppress native scrolling or zooming.&lt;br /&gt;
&lt;br /&gt;
[[Category:Studio]]&lt;/div&gt;</summary>
		<author><name>BROT42</name></author>
	</entry>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=30798</id>
		<title>Your game mobile version</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=30798"/>
		<updated>2026-07-23T14:24:13Z</updated>

		<summary type="html">&lt;p&gt;BROT42: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Studio_Framework_Navigation}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Board Game Arena supports mobile phones and tablets. Most games are already playable on touch devices, but their layout and interactions still need to work on narrow screens.&lt;br /&gt;
&lt;br /&gt;
== Declare your interface minimum width ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;game_interface_width.min&amp;lt;/code&amp;gt; is the smallest logical width at which your game remains usable. The default is 740 pixels.&lt;br /&gt;
&lt;br /&gt;
Declare it in &#039;&#039;&#039;gameinfos.jsonc&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;game_interface_width&amp;quot;: {&lt;br /&gt;
      // Smallest usable width. Default: 740&lt;br /&gt;
      &amp;quot;min&amp;quot;: 540,&lt;br /&gt;
  &lt;br /&gt;
      // Default: true&lt;br /&gt;
      &amp;quot;autoscale&amp;quot;: true&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The declared width must actually work. If you declare 540 pixels, the complete interface must remain usable at 540 pixels.&lt;br /&gt;
&lt;br /&gt;
Keep the minimum as low as reasonably possible. Large values require stronger scaling on phones, make content smaller, and increase rendering work. Use fluid layouts and CSS media queries instead of declaring a large fixed width.&lt;br /&gt;
&lt;br /&gt;
Below 490 pixels, player panels may no longer use a two-column mobile layout.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
* In &#039;&#039;&#039;Can&#039;t Stop&#039;&#039;&#039;, the dice are moved below the board on narrow screens:&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 990px) {&lt;br /&gt;
      #dicechoices {&lt;br /&gt;
          left: 180px;&lt;br /&gt;
          top: 530px;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      #cantstop_wrap {&lt;br /&gt;
          height: 900px;&lt;br /&gt;
          width: 550px;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* In &#039;&#039;&#039;Seasons&#039;&#039;&#039;, panels normally displayed to the right of the board are moved below it:&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 970px) {&lt;br /&gt;
      #board {&lt;br /&gt;
          float: none;&lt;br /&gt;
          margin: auto;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      .seasons_rightpanel {&lt;br /&gt;
          margin-left: 0;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
On mobile, BGA moves player panels above the game and adds &amp;lt;code&amp;gt;mobile_version&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#ebd-body&amp;lt;/code&amp;gt;. The desktop layout uses &amp;lt;code&amp;gt;desktop_version&amp;lt;/code&amp;gt;. Use these classes for layout-specific CSS.&lt;br /&gt;
&lt;br /&gt;
=== Autoscale ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;game_interface_width.autoscale&amp;lt;/code&amp;gt; controls what happens when the available width is smaller than &amp;lt;code&amp;gt;min&amp;lt;/code&amp;gt;. It accepts &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt;. The default is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The examples below use a 740-pixel game displayed in 390 pixels of available space.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;autoscale: true&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
BGA applies CSS &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; to the game content. In the example, the scale is approximately 53%.&lt;br /&gt;
&lt;br /&gt;
The game content scales independently from the surrounding BGA interface:&lt;br /&gt;
&lt;br /&gt;
* the top bar and tableview chat keep their normal size;&lt;br /&gt;
* the action bar and player panels use separate framework scaling on very narrow screens;&lt;br /&gt;
* standard BGA dialogs and tooltips generally keep their normal size;&lt;br /&gt;
* overlays inside the game area inherit the game zoom.&lt;br /&gt;
&lt;br /&gt;
This is the default mode and should suit most fixed-width games.&lt;br /&gt;
&lt;br /&gt;
===== Coordinates and animations =====&lt;br /&gt;
&lt;br /&gt;
Browsers do not return consistent geometry for elements using CSS zoom. For custom positioning inside the zoomed game area, use:&lt;br /&gt;
&lt;br /&gt;
  const rect = this.getBoundingClientRectIgnoreZoom(&amp;quot;my-element&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It returns logical, unscaled coordinates. BGA animation and positioning helpers already account for framework zoom.&lt;br /&gt;
&lt;br /&gt;
Use the native &amp;lt;code&amp;gt;getBoundingClientRect()&amp;lt;/code&amp;gt; when you need the visual position in the browser viewport, such as for an overlay outside the zoomed game area.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;autoscale: false&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
BGA does not scale the game area.&lt;br /&gt;
&lt;br /&gt;
Use this for responsive games or games with their own scaling system, such as [[BgaZoom]]. A fixed 740-pixel layout displayed in 390 pixels will otherwise overflow horizontally and may require scrolling.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;autoscale: &amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
This mode scales the whole game document through a wider logical viewport.&lt;br /&gt;
&lt;br /&gt;
Previously, when game pages were opened directly, BGA set the document viewport width and let the mobile browser fit it to the screen.&lt;br /&gt;
&lt;br /&gt;
Games are now normally opened through &amp;lt;code&amp;gt;/tableview&amp;lt;/code&amp;gt;. The game runs in an iframe, and its viewport cannot resize that iframe. Tableview emulates the same result by laying out the iframe at the requested width and applying &amp;lt;code&amp;gt;transform: scale(...)&amp;lt;/code&amp;gt; to it.&lt;br /&gt;
&lt;br /&gt;
In the example, the iframe is laid out at 740 pixels and displayed at approximately 53% scale. The game area and the BGA controls inside the iframe are scaled together.&lt;br /&gt;
&lt;br /&gt;
CSS &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; participates in layout. &amp;lt;code&amp;gt;transform: scale(...)&amp;lt;/code&amp;gt; scales after layout and usually creates a composited layer. Transforming a large iframe can be expensive on mobile devices.&lt;br /&gt;
&lt;br /&gt;
Prefer &amp;lt;code&amp;gt;autoscale: true&amp;lt;/code&amp;gt; or a responsive layout unless viewport scaling is required for compatibility.&lt;br /&gt;
&lt;br /&gt;
==== Legacy &amp;lt;code&amp;gt;default_viewport&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
Some older games contain code such as:&lt;br /&gt;
&lt;br /&gt;
  this.default_viewport = &amp;quot;width=740&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;default_viewport&amp;lt;/code&amp;gt; started as internal framework state. Games later used it as an undocumented viewport override before &amp;lt;code&amp;gt;game_interface_width.autoscale&amp;lt;/code&amp;gt; existed.&lt;br /&gt;
&lt;br /&gt;
It remains supported to avoid breaking published games. In tableview, it enables the same iframe scaling as &amp;lt;code&amp;gt;autoscale: &amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt; and takes precedence over the configured autoscaling mode.&lt;br /&gt;
&lt;br /&gt;
Do not use it in new code. Existing games should test removing it and use &amp;lt;code&amp;gt;game_interface_width&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
==== Mobile rendering performance ====&lt;br /&gt;
&lt;br /&gt;
Large transformed interfaces can crash iOS browsers during pinch zoom. See [https://boardgamearena.com/bug?id=229359 BGA bug #229359] and [https://bugs.webkit.org/show_bug.cgi?id=172206 WebKit bug #172206].&lt;br /&gt;
&lt;br /&gt;
Reduce the risk:&lt;br /&gt;
&lt;br /&gt;
* keep interface dimensions reasonable;&lt;br /&gt;
* reduce image pixel dimensions and file sizes;&lt;br /&gt;
* avoid unnecessarily large sprite sheets;&lt;br /&gt;
* limit large fixed or transformed elements;&lt;br /&gt;
* avoid unnecessary animation, canvas, and WebGL rendering;&lt;br /&gt;
&lt;br /&gt;
== Touchscreen compatibility ==&lt;br /&gt;
&lt;br /&gt;
BGA adds &amp;lt;code&amp;gt;touch-device&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#ebd-body&amp;lt;/code&amp;gt; when it detects a touchscreen, and &amp;lt;code&amp;gt;notouch-device&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CSS &amp;lt;code&amp;gt;:hover&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Touch devices have no persistent mouse cursor. Some emulate &amp;lt;code&amp;gt;:hover&amp;lt;/code&amp;gt; after a short touch, which can block the intended interaction. Prefix hover-only rules with &amp;lt;code&amp;gt;.notouch-device&amp;lt;/code&amp;gt; when they should not apply to touchscreens.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tooltips&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Do not make required information available only through hover. Provide a touch-accessible alternative.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mouse events&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Do not rely only on mouse-specific events such as &amp;lt;code&amp;gt;mouseover&amp;lt;/code&amp;gt;. Prefer the [https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events Pointer Events API], which supports mouse, touch, and pen input.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Drag and drop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Common approaches:&lt;br /&gt;
&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events Pointer Events API]&lt;br /&gt;
** Example: https://codepen.io/VictoriaLa/pen/MWOgYYZ&lt;br /&gt;
** Game example: Century&lt;br /&gt;
&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API Native HTML drag and drop]&lt;br /&gt;
** Example: https://codepen.io/VictoriaLa/pen/rNGXKxj&lt;br /&gt;
** Game example: Patchwork&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;touch-action: none&amp;lt;/code&amp;gt; only to elements where you handle touch or pointer gestures and need to suppress native scrolling or zooming.&lt;br /&gt;
&lt;br /&gt;
[[Category:Studio]]&lt;/div&gt;</summary>
		<author><name>BROT42</name></author>
	</entry>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=30797</id>
		<title>Your game mobile version</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=30797"/>
		<updated>2026-07-23T14:20:50Z</updated>

		<summary type="html">&lt;p&gt;BROT42: clarify game_interface_width.autoscale and overall polish&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Studio_Framework_Navigation}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Board Game Arena supports mobile phones and tablets. Most games are already playable on touch devices, but their layout and interactions still need to work on narrow screens.&lt;br /&gt;
&lt;br /&gt;
== Declare your interface minimum width ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;game_interface_width.min&amp;lt;/code&amp;gt; is the smallest logical width at which your game remains usable. The default is 740 pixels.&lt;br /&gt;
&lt;br /&gt;
Declare it in &#039;&#039;&#039;gameinfos.jsonc&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;game_interface_width&amp;quot;: {&lt;br /&gt;
      // Smallest usable width. Default: 740&lt;br /&gt;
      &amp;quot;min&amp;quot;: 540,&lt;br /&gt;
  &lt;br /&gt;
      // Default: true&lt;br /&gt;
      &amp;quot;autoscale&amp;quot;: true&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The declared width must actually work. If you declare 540 pixels, the complete interface must remain usable at 540 pixels.&lt;br /&gt;
&lt;br /&gt;
Keep the minimum as low as reasonably possible. Large values require stronger scaling on phones, make content smaller, and increase rendering work. Use fluid layouts and CSS media queries instead of declaring a large fixed width.&lt;br /&gt;
&lt;br /&gt;
Below 490 pixels, player panels may no longer use a two-column mobile layout.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
* In &#039;&#039;&#039;Can&#039;t Stop&#039;&#039;&#039;, the dice are moved below the board on narrow screens:&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 990px) {&lt;br /&gt;
      #dicechoices {&lt;br /&gt;
          left: 180px;&lt;br /&gt;
          top: 530px;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      #cantstop_wrap {&lt;br /&gt;
          height: 900px;&lt;br /&gt;
          width: 550px;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* In &#039;&#039;&#039;Seasons&#039;&#039;&#039;, panels normally displayed to the right of the board are moved below it:&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 970px) {&lt;br /&gt;
      #board {&lt;br /&gt;
          float: none;&lt;br /&gt;
          margin: auto;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      .seasons_rightpanel {&lt;br /&gt;
          margin-left: 0;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
On mobile, BGA moves player panels above the game and adds &amp;lt;code&amp;gt;mobile_version&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#ebd-body&amp;lt;/code&amp;gt;. The desktop layout uses &amp;lt;code&amp;gt;desktop_version&amp;lt;/code&amp;gt;. Use these classes for layout-specific CSS.&lt;br /&gt;
&lt;br /&gt;
=== Autoscale ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;game_interface_width.autoscale&amp;lt;/code&amp;gt; controls what happens when the available width is smaller than &amp;lt;code&amp;gt;min&amp;lt;/code&amp;gt;. It accepts &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt;. The default is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The examples below use a 740-pixel game displayed in 390 pixels of available space.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;autoscale: true&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
BGA applies CSS &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; to the game content. In the example, the scale is approximately 53%.&lt;br /&gt;
&lt;br /&gt;
The game content scales independently from the surrounding BGA interface:&lt;br /&gt;
&lt;br /&gt;
* the top bar and tableview chat keep their normal size;&lt;br /&gt;
* the action bar and player panels use separate framework scaling on very narrow screens;&lt;br /&gt;
* standard BGA dialogs and tooltips generally keep their normal size;&lt;br /&gt;
* overlays inside the game area inherit the game zoom.&lt;br /&gt;
&lt;br /&gt;
This is the default mode and should suit most fixed-width games.&lt;br /&gt;
&lt;br /&gt;
===== Coordinates and animations =====&lt;br /&gt;
&lt;br /&gt;
Browsers do not return consistent geometry for elements using CSS zoom. For custom positioning inside the zoomed game area, use:&lt;br /&gt;
&lt;br /&gt;
  const rect = this.getBoundingClientRectIgnoreZoom(&amp;quot;my-element&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It returns logical, unscaled coordinates. BGA animation and positioning helpers already account for framework zoom.&lt;br /&gt;
&lt;br /&gt;
Use the native &amp;lt;code&amp;gt;getBoundingClientRect()&amp;lt;/code&amp;gt; when you need the visual position in the browser viewport, such as for an overlay outside the zoomed game area.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;autoscale: false&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
BGA does not scale the game area.&lt;br /&gt;
&lt;br /&gt;
Use this for responsive games or games with their own scaling system, such as [[BgaZoom]]. A fixed 740-pixel layout displayed in 390 pixels will otherwise overflow horizontally and may require scrolling.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;autoscale: &amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
This mode scales the whole game document through a wider logical viewport.&lt;br /&gt;
&lt;br /&gt;
Previously, when game pages were opened directly, BGA set the document viewport width and let the mobile browser fit it to the screen.&lt;br /&gt;
&lt;br /&gt;
Games are now normally opened through &amp;lt;code&amp;gt;/tableview&amp;lt;/code&amp;gt;. The game runs in an iframe, and its viewport cannot resize that iframe. Tableview emulates the same result by laying out the iframe at the requested width and applying &amp;lt;code&amp;gt;transform: scale(...)&amp;lt;/code&amp;gt; to it.&lt;br /&gt;
&lt;br /&gt;
In the example, the iframe is laid out at 740 pixels and displayed at approximately 53% scale. The game area and the BGA controls inside the iframe are scaled together.&lt;br /&gt;
&lt;br /&gt;
CSS &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; participates in layout. &amp;lt;code&amp;gt;transform: scale(...)&amp;lt;/code&amp;gt; scales after layout and usually creates a composited layer. Transforming a large iframe can be expensive on mobile devices.&lt;br /&gt;
&lt;br /&gt;
Prefer &amp;lt;code&amp;gt;autoscale: true&amp;lt;/code&amp;gt; or a responsive layout unless viewport scaling is required for compatibility.&lt;br /&gt;
&lt;br /&gt;
==== Legacy &amp;lt;code&amp;gt;default_viewport&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
Some older games contain code such as:&lt;br /&gt;
&lt;br /&gt;
  this.default_viewport = &amp;quot;width=740&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;default_viewport&amp;lt;/code&amp;gt; started as internal framework state. Games later used it as an undocumented viewport override before &amp;lt;code&amp;gt;game_interface_width.autoscale&amp;lt;/code&amp;gt; existed.&lt;br /&gt;
&lt;br /&gt;
It remains supported to avoid breaking published games. In tableview, it enables the same iframe scaling as &amp;lt;code&amp;gt;autoscale: &amp;quot;viewport&amp;quot;&amp;lt;/code&amp;gt; and takes precedence over the configured autoscaling mode.&lt;br /&gt;
&lt;br /&gt;
Do not use it in new code. Existing games should test removing it and use &amp;lt;code&amp;gt;game_interface_width&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
==== Mobile rendering performance ====&lt;br /&gt;
&lt;br /&gt;
Large transformed interfaces can crash iOS browsers during pinch zoom. See [https://boardgamearena.com/bug?id=229359 BGA bug #229359] and [https://bugs.webkit.org/show_bug.cgi?id=172206 WebKit bug #172206].&lt;br /&gt;
&lt;br /&gt;
Reduce the risk:&lt;br /&gt;
&lt;br /&gt;
* keep interface dimensions reasonable;&lt;br /&gt;
* reduce image pixel dimensions and file sizes;&lt;br /&gt;
* avoid unnecessarily large sprite sheets;&lt;br /&gt;
* limit large fixed or transformed elements;&lt;br /&gt;
* avoid unnecessary animation, canvas, and WebGL rendering;&lt;br /&gt;
* test through &amp;lt;code&amp;gt;/tableview&amp;lt;/code&amp;gt;, including pinch zoom on iOS.&lt;br /&gt;
&lt;br /&gt;
== Touchscreen compatibility ==&lt;br /&gt;
&lt;br /&gt;
BGA adds &amp;lt;code&amp;gt;touch-device&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#ebd-body&amp;lt;/code&amp;gt; when it detects a touchscreen, and &amp;lt;code&amp;gt;notouch-device&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CSS &amp;lt;code&amp;gt;:hover&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Touch devices have no persistent mouse cursor. Some emulate &amp;lt;code&amp;gt;:hover&amp;lt;/code&amp;gt; after a short touch, which can block the intended interaction. Prefix hover-only rules with &amp;lt;code&amp;gt;.notouch-device&amp;lt;/code&amp;gt; when they should not apply to touchscreens.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tooltips&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Do not make required information available only through hover. Provide a touch-accessible alternative.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mouse events&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Do not rely only on mouse-specific events such as &amp;lt;code&amp;gt;mouseover&amp;lt;/code&amp;gt;. Prefer the [https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events Pointer Events API], which supports mouse, touch, and pen input.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Drag and drop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Common approaches:&lt;br /&gt;
&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events Pointer Events API]&lt;br /&gt;
** Example: https://codepen.io/VictoriaLa/pen/MWOgYYZ&lt;br /&gt;
** Game example: Century&lt;br /&gt;
&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API Native HTML drag and drop]&lt;br /&gt;
** Example: https://codepen.io/VictoriaLa/pen/rNGXKxj&lt;br /&gt;
** Game example: Patchwork&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;touch-action: none&amp;lt;/code&amp;gt; only to elements where you handle touch or pointer gestures and need to suppress native scrolling or zooming.&lt;br /&gt;
&lt;br /&gt;
[[Category:Studio]]&lt;/div&gt;</summary>
		<author><name>BROT42</name></author>
	</entry>
</feed>