Screenres.txt - vpinball/b2s-backglass GitHub Wiki

If you do a fresh install or, in Case you lost it by mistake - you will need to have a screenres.txt fitting to your system.

What is a ScreenRes.txt? The ScreenRes.txt contains all information the server needs to know the positions and sizes of your Backglass, B2S-DMD and Background-Pictures if you use it. If you have no tablename.res file with your table, the B2S Server will use the settings from the global ScreenRes.txt file instead which is located in your Backglass Server or tables folder.

The default filename ScreenRes.txt can be altered by setting the registry key Software\B2S\B2SScreenResFileNameOverride to a different filename.

When the B2S Server starts, it tries to find the ScreenRes files in this order:

  1. tablename.res next to the tablename.vpx
  2. Screenres.txt ( or whatever you set in the registry) in the same folder as tablename.vpx
  3. Screenres.txt ( or whatever you set in the registry) as tablename/Screenres.txt
  4. Screenres.txt ( or whatever you set in the registry) in the folder where the B2SBackglassServerEXE.exe is located. (V1.4.1)

From B2S Server release 1.3.1.1 comment lines starting with a "#" are supported. If you use tools (or old releases) not supporting comments, you need to remove these lines or let B2SScreenResIdentifier.exe do it for you!

Example ScreenRes file:

# This is a ScreenRes file for the B2SBackglassServer. 
# Playfield Screen resolution width/height
2560
1440
# Backglass width/height (or background when StartBackground is active)
1920
1080
# Backglass Display Devicename screen number (\\.\DISPLAY)x for the Playfield or screen on position (@x) or screen index (=x)
2
# X/Y position for the backglass relative to the upper left corner of the selected screen (background when StartBackground is active)
0
0
# width/height of the DMD area in pixels - For 3 screen setup (DMD gets defaults when set to 0/0)
0
0
# X/Y position of the DMD area relative to the upper left corner of the backglass screen - For 3 screen setup
0
0
# Y-flip, flips the LED display upside down
0
# Backglass X/Y position when StartBackground is active, relative to upper left corner of the selected screen
0
0
# Backglass width/height when StartBackground is active
0
0
# C:\path\Frame = The path to the location where you have the background image or black if none selected.
#C:\path\my_bezel_for_EM_or_grill_for_dual_screen.png

Background (so called small button)

As you see in the comments above, the format has become a little complicated, depending on if you have Background/small button active in the settings, the lines in the file have different meaning:

  Background OFF ON (V2.0.0) Changed meaning < 2.0.0 ON < 2.0.0
Playfield Screen width 2560 2560   2560
Playfield Screen height 1440 1440   1440
Backglass width 1920 (*) 1920 Background width 1920 (*)
Backglass height 880 (*) 880 Background height 200 (*)
Backglass Display Devicename 2 2   2
Backglass X position 0 (*) 0 Background X position 0 (*)
Backglass Y position 0 (*) 0 Background Y position 200 (*)
DMD width 0 0   0
DMD height 0 0   0
DMD X position 0 0   0
DMD Y position 0 0   0
Y-flip 0 0   0
Background not active 0 0 Backglass X position 0 (*)
Background not active 0 200 Backglass X position 0 (*)
Background not active 0 1920 Backglass width 1920 (*)
Background not active 0 200 Backglass height 880 (*)
Background not active   C:\... Background picture file path C:\...

the values marked (*) has switched position to work as intended WHEN the background (small) button is active in the settings. It took a while to grasp for me as well...

With 2.0.0 this is now solved by adding a line in the ScreenRes file starting with: # V2 to mark the new version of the file format. This way the B2S BackglassServer knows that the values should stay as is, and if this line is missing, it is an old version of the file. For files with comments turned off, this line is added last, hoping it should not break anything in other tools (apart from the values not switched).

You can edit your screenres.txt with your favorite text editor or - you can use the included B2SScreenResIdentifier.exe.

The B2SScreenResIdentifier does not automatically switch the values depending on any setting, instead there is a button called "<-> Background" on the Backglass window, which switches the values (and moves the windows).

When you activate the Background frame, B2SScreenResIdentifier defaults to use V2 file format, in case you do not want the new format, you will have to handle the value switch "manually" or by using the "<-> Background" button and then save the file.




Backglass Display Devicename

The backglass device name line in the ScreenRes file can contain a number which is the Devicename screen number as in \\.\DISPLAY## (## is your screen number). To find out the device name you can run B2SScreenResIdentifier.exe and have a look:

B2S_ScreenResIdentifierDMD

Each of the forms in B2S_ScreenResIdentifier.exe shows the device name as "Current screen".

In the same field you can choose to use @#### (#### is the X position from the top left corner) or even =# where # is the screen index position counted from left to right. So for anyone following the introduction page Read-this-first!!!, setting the value to "=2" should mean the second screen from the left. You do NOT NEED to know the starting xposition of your normal backglass montior...

This should be stable no matter what Windows decides to do with the device name at the next reboot. It should be pretty stable even if you change your playfield to a higher resolution...

What if you can change ALL your screenres files in one go? Well you can...

Notepad++ChangingAllScreenResAtOnce

Using 🌍Notepad++ and again a little 🌍regular expressions magic. It is possible to replace all single "^2$" on a line to "=2" in all *.res files in a folder path.

⚠️ **GitHub.com Fallback** ⚠️