Backgrounds - vpinball/b2s-backglass GitHub Wiki

The background is an additional window for for displaying an image file (jpg, png). Originally meant as a background, but it can be used for other things as well. For this it is necessary to specify size and position and the path to the image file in the respective Tablename.res file and activate the background in the Settings. (This feature was called "small" earlier)

You can use your background in combination with your Backglass to "fill" black bars caused by different resolutions of Backglass Screen and Backglass. (5:4 Backglass on 16:9 Screen for Example) or as a single Background Window, if you move the Backglass out of Screen.

Video

B2S-Server 2.0 - Backgrounds

Backgrounds for Tables without Backglass

To use a Image with a table that has no Backglass, you need to use a dummy Backglass. Take a copy of any backglass and rename it to load with your table. Without this, you can not display the Background Image. After loading your table with your dummy backglass, configure, move and/or resize your background with B2SScreenResIdentifier. If you are happy with your Background Settings, move your dummy Backglass out of your screen: Example: Screen is 1920x1080 - set Backglass X Position to 1921 or y Position to 1081 This way you can use a image instead of a Backglass if you have no fitting Backglass for your table.

Template placeholders in the background filename

Res file with a backgound filename containing template keys
# V2.0.0-c311a21
# File is saved with B2S_ScreenResIdentifier release 2.0.0 adding the first line means it will not flip the Backglass & Background size and position
# Playfield Screen resolution width/height
1920
1080
# width/height of the Backglass
1280
655
# Define Backglass using the screen index (=x) -> **It is always the second screen from left**
=2
# Backglass x/y position relative to the upper left corner Of the screen selected
0
0
# width/height Of the B2S (or Full) DMD area In pixels
676
320
# X/Y position Of the DMD area relative To the upper left corner of the backglass screen
303
681
# Y-flip, flips the LED display upside down
0
# X/Y position of the background
0
655
# width/height of the background
1280
369
# path to the background image (C:\path\Frame)
c:\vPinball\B2SServer\backgrounds\Grill{manufactor}.png

From release 2.0.3 it is possible to enter a path with placeholders for "keys" in the table name. These keys are extracted using regular expressions:

from a table name e.g. "Blood Machines (VPW 2022) V1.21" it extracts as "{name} ({manufactor} {year}) {extra}" to {name}="Blood Machines" {manufactor}="VPW" {year}="2022" {extra}="V1.21".

Additionally two hard coded placeholders are used: {tablename}="Blood Machines (VPW 2022) V1.21" and {gamename}="the rom name"

So if the background picture path is entered like "c:\vPinball\B2SServer\backgrounds\SpikeGrill{manufactor}.png" in the res file, it will be replaced with "c:\vPinball\B2SServer\backgrounds\SpikeGrillVPW.png" when the server tries to find the background.

If the template filename is setup smart, you can make it try these one by one, until one is found: (in this order)

C:\vPinball\B2SServer\Backgrounds\SpikeGrillBlood Machines (VPW 2022) V1.21.png or C:\vPinball\B2SServer\Backgrounds\SpikeGrillBlood Machines.png or C:\vPinball\B2SServer\Backgrounds\SpikeGrillVPW.png or C:\vPinball\B2SServer\Backgrounds\SpikeGrill2022.png and so on. C:\vPinball\B2SServer\Backgrounds\SpikeGrill.png

First found, first taken!

BUT it will NOT do all permutations combining more than one placeholder!

If no keys can be extracted from the table name, all combinations {name}, {year}... are replaced with an empty string and would become "c:\vPinball\B2SServer\backgrounds\Grill.png" in this example.

Using this feature, one .res file can be used for many tables, but have minor differences in the layout of the pictures.

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