Resolution Magic 2D is a Unity asset that males fitting your game onto different screen shapes and sizes so easy it feels like magic.
Resolution Magic 2D adds automatic screen resolution matching to your game. Simply install the asset and add a prefab to your scene and it will automatically work to ensure your game looks great on any device, regardless of screen resolution or ratio.
How Does it Work?
Resolution Magic adjusts the orthographic (2D) camera to the size that will show all your defined area as large as possible on the current screen size and shape. Setup can be as simple as adding a prefab to your scene and setting the AlwaysDisplayedArea rectangle to cover the area that represents your ideal game view.
- Ensures the important area of your game is always visible to all players regardless of their screen or device size and shape
- Can be 100% setup without any coding
- Can automatically adjust when the screen size changes (e.g. a phone rotating from landscape to portrait
- Prefab customisable in the Unity Inspector to support different needs
- Optionally add ‘black bars’ to your game if you don’t want content outside your main game area to be visible
What is Resolution Magic?
Get the asset
Resolution Magic 2D will save you tons of work to cater your game to all the different screen sizes and shapes that Unity games support.
View Resolution Magic 2D in the Unity Asset Store.
With so many devices out there it’s difficult to make your game work well on all possible screens. Here are some screens showing how Resolution Magic solves that problem.
Imagine this sports game played by aliens from the planet Kenney:
The scene inside the Unity editor
I want the green court area to fill up as much screen space as possible. Anything in the yellow area is filler that I only want my player to see if their screen is not the same shape as the green court.
Without Resolution Magic
I designed this game with a 16:9 ratio, and here’s what it looks like on a 16:9 device:
A perfect view of whatever sport those critters are player on 16:9 screens (regardless of pixel resolution). But what about the players who don’t have 16:9 screens?
3:2 (iPhone and iPad devices):
Oh no! The goalies have fallen off the screen because it’s not as wide as the game design!
16:10 (Windows Phone / Android)
Not quite as bad as the 3:2, but the edges are still cut off. The game might be playable, but you can’t publish it to an app store in that state!
Unity leaves your content alone, not adapting to the screen it’s on. It’s not good enough!
With Resolution Magic 2D
Here are images from the same scene with Resolution Magic 2D enabled.
Remember, I told Resolution Magic to make the green area fill as much screen as possible and to show anything in the yellow area only if the screen is a different shape (aspect ratio) to the green court.
Since the game was designed for 16:9 this image looks identical to the one without Resolution Magic.
There’s the magic. Resolution Magic makes sure the entire court area stays on the screen (with some of the crowd in the yellow area visible in the ‘dead space’ created by using a different aspect ratio to what you designed). Your player sees everything they should! Like magic.
16:10 (Android, Windows Phone)
Since Resolution Magic works with any screen resolution or ratio, the 16:10 view also makes the court as large as possible without cutting anything off. Some of the crowd is still visible because the game design is wider than the screen.
Fit to background
Resolution Magic 2D also lets you set a second, larger area of interest so you can further adapt your game. In the following screenshot I have told Resolution Magic 2D to show the entire game area instead of just the court:
The scaling still works, but now you have a view that gives users with larger, higher-resolution screens a more interesting scene, while you can still focus on the court for smaller devices where every pixel matters.
Q: Does Resolution Magic 2D work on [platform]?
A: Yes. Resolution Magic 2D works completely in Unity code with no fancy addons or platform-specific code.
Q: Does Resolution Magic 2D work with the Unity UI introduced in Unity 4.6?
A: Yes. Resolution Magic 2D doesn’t interact with the UI at all, and the UI doesn’t affect Resolution Magic 2D’s camera scaling.
Q: What does it do and when?
A: Resolution Magic 2D’s main functionality is to scale and position the camera so that your chosen content is visible to all players and fills the screen as much as possible (based on the screen ratio). It does this at the start of a scene, and once the scene starts Resolution Magic doesn’t need to do anything. You can optionally check for resolution changes (e.g. going from portrait to landscape), which can be useful on some platforms. Resolution Magic will then automatically update the view to match the new screen resolution.
Q: Does it work with [Unity version]?
A: Resolution Magic 2D works on every version of Unity, and has been tested with versions including the newest betas for 2021 versions.
Resolution Magic 2D works by resizing the camera, and uses very basic functionality that has been in Unity for years and is unlikely to change.
Q: Does it work with 3D games?
A: No. Resolution Magic 2D is designed to modify 2d (orthographic) camera settings. Use in 3D games is not supported at all.
However, if your game has any 2D scenes – menus, cutscenes, etc., you can use Resolution Magic 2D in those scenes.