Background Image Fit to Any Device Resolution - Paper2D

Hello.

TL;DR: I need my background image to look exactly the same across all devices that my game is played on. My background is static. Does the camera need adjusted? Does my image need adjusted? Is this even possible to do?

I’m incredibly new to UE4, and right now I’m working on a simple game that I want to be able to play on mobile devices like iOS and Android, as well as HTML5, maybe even PC and Mac, but that’s further down the road. It’s a 2D game that will only be playable in portrait mode no matter what device it is played on. I’m using Paper2D to make the level and other assets, but I can’t seem to figure out how to get the background to scale to fit each device that I test it on.

What I’ve done is something similar to the Tappy Chicken project from Epic. I’ve created a main game blueprint and added a camera to it, along with my background sprite, which is static and will never animate or scroll - it’ll always be there. For now I’ve used the Tappy Chicken blueprint code to get the camera situated in an orthographic view. It took me a long while just to get the image to fit the viewport of the camera by nudging the background in place, testing, scaling, nudging, testing, etc (although doing that didn’t feel right, maybe it was right, I’m not sure). Eventually, I want four assets to be evenly placed on the ground of my background image and they won’t ever move, but they will do something once they’re all coded.

So my problem:

How do I make the background scale to fit the device I am playing on? Is that possible? Example of what I want below:

Obviously, you can see that my example has the background scaled for each device, and the background looks all squashed and distorted. I don’t want that to happen (obviously this happened because my image is in landscape orientation right now). I want the background image to look the same for each device. No clipping, no distortion, if that’s even possible. I’d rather not have the devices sort of act as “windows” that can only see a portion of the background image I’ve created based on that device’s resolution. My first guess would be to make the image portrait, rather than landscape, which I can easily do. But does the camera need to be adjusted for that? I’m honestly very lost at this point.

Thank you so much for the help!

I figured it out. [This post][1] was what I was looking for.

I needed to set my camera’s aspect ratio to 0.5625 which is an aspect ratio of 9:16 because of the portrait orientation.

http://i.imgur.com/v3n15st.png

This allows for the portrait view I was looking for, and it ensured that my background fit properly on each device I play it on without any clipping or distortion (assuming my background image is also 9:16, which it is). I hope someone else finds this helpful.

EDIT: While this answered my question it didn’t quite help me account for devices with aspect ratios that aren’t 9:16, such as the iPhone 4, and the iPad 2-4. Nearly all non-Apple devices are 9:16 when in portrait orientation. So I’ll need to come up with some way to scale the background when playing on Apple devices.