Tutorial Creating HUD Overlay for Desktops and Pinball Cabinets

GeorgeH

Flippered Out
Staff member
Site Supporters
Everyone knows a HUD overlay is squeezed together when it is displayed on a monitor that is rotated to 270 degrees. I have found you can create an extra wide version of the overlay that will display textures correctly at 270 degrees but then of course it will look stretched apart at 0 degrees. I sent @ravarcade a message saying I wanted to be able to switch between 2 overlays and asked if there is a way I can identify the setting for rotation (0, 90, 180, 270) that an end user selects. He said this script would accomplish what I want:

xBAM.Camera.AspectRatio < 1.0 ' screen is wide (the end user selected either 0 or 180 degrees rotation)
xBAM.Camera.AspectRatio > 1.0 ' screen is tall (the end user selected either 90 or 270 degrees rotation)

In conclusion, you can create 2 versions of the same overlay, one that displays correctly on a desktop (normally using 0 degrees rotation) and another that displays correctly on a pinball cabinet (which normally use 270 degrees rotation). You need to use the same image list for both overlays. Then, you can then use Rafal's code to select which overlay is displayed.

I have found that I can code both overlays identically and use a transparent texture to turn the display on and off without using the fade functions. Then I can add this code to the "BeginPlay" subroutine and the correct overlay will be displayed:
If xBAM.Camera.AspectRatio =< 1.0 then Overlay2.fadeout ' screen is wide
If xBAM.Camera.AspectRatio > 1.0 then Overlay1.fadeout ' screen is tall
This works by having both overlays display the same thing with one of the overlays faded out. The overlays can still be coded if you use the fade functions in places other than the above but it is not quite as simple.

I created the attached demo file so you can play a table after switching the degrees rotation to 0 or 270 to see it work. It includes the fail safe coding that you may want to use (though be aware that if one of the displays is not faded out, you will have 2 overlays being displayed at the same time).

I included an Excel file in the download that you can use to calculate the size of an overlay based on the dimensions of your texture.
 

Attachments

Last edited:

GeorgeH

Flippered Out
Staff member
Site Supporters
I have already updated the posting to include an Excel file that helps you figure out the correct size of an overlay. It identifies the size needed for overlays on screen rotations of 0, 90, 180 and 270. You may want to use it even if you are only interested in sizing an overlay for 0 degrees rotation. That is because Future Pinball stretches the texture out more than the texture. Another way of saying it is if you add a picture of a person and size the overlay by dividing the height and width of your texture by 2, then the person will be too fat.

I replaced the picture in the demo file so it shows 2 guys riding bicycles. You can detect distortion of pictures of humans and circles almost immediately.
 

GeorgeH

Flippered Out
Staff member
Site Supporters
I posted the final version of my Excel file on Message 1 above. I used it a lot on the "Road Girls" table. It takes the guess work out of sizing overlays so they are not distorted. It is useful even it you do not use the Camera.AspectRatio code.

It is pretty easy to use. You just key in the width and height of your texture. Then you key in either the width (or height) of your overlay and it will tell you the height (or width) of your overlay.
 
Last edited:

TerryRed

Pinball Wizard
The only bummer is you can't adjust "DMDs" and other certain things in the same way you can with an overlay for adjusting the aspect ratio (DMDs are "stuck and stretched")

With PinEvent tables and pup-packs using pup stream...at least that is only using overlays / huds / holograms for the pup displays....so those can also be adjusted to work in a similar manner if needed to look correct.
 
Last edited:

GeorgeH

Flippered Out
Staff member
Site Supporters
This pretty much applies to overlays only. It doesn't work on DMDs and segmented displays. You mentioned holograms. They can't be used on a HUD but you should be able to size them using the non-HUD secion of the Excel file I created.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
    Top