How can I create an overlay that is both vertical and horizontal?

I am creating an overlay for a RetroArch project for an arcade cabinet, in which the screen can rotate 90 degrees to enable horizontal or vertical gameplay.

I have created two images for each scenario. However, what I am unsure about is whether it’s possible to create an overlay where the .cfg file can define that a specific PNG file should be used for horizontal mode and a different PNG file for vertical mode.

Is it achievable within a single .cfg file?

Thank you very much for the assistance.

1 Like

yes, this is possible, but unless the device is “aware” of its orientation (e.g., Android or iOS device), you will need to include a way to change the orientation on the fly (such as a button on the overlay; it could be fully transparent/invisible and could even cover the entire screen).

I haven’t tried it with a shader other than the Mega Bezel, but you could try using the “imgborder.slangp” shader and the new wildcard feature.

It would require a third vertical image for 270 degree rotation.

1 Like

I apologize for not specifying in the question. I’m using a Xiaomi Redmi Pad as the device, and it will be controlled by a servo motor that will rotate it 90 degrees, so the rotation is automatic when the tablet is rotated.

What I’ve never done before is create the .cfg file. Looking at other files, I’ve created this one, but I’m not sure if it’s complete or if there’s something wrong:


overlays = 2

overlay0_full_screen = true
overlay0_name = "landscape"
overlay0_overlay = "test_landscape.png"
overlay0_descs = 0

overlay1_full_screen = true
overlay1_name = "portrait"
overlay1_overlay = "test_portrait.png"
overlay1_descs = 0


1 Like

Yes, as long as it has ‘landscape’ or ‘portrait’ in the overlay name, it should switch automatically on rotation detect. I don’t love the “magic word”-ness, but it works.

1 Like