Extending viewport adapter
Coming from LibGDX, I was trying to find an implementation of something that is shipped with LibGDX that extends the viewport in either direction (with limits) that works really well for a lot of scenarios:
https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/utils/viewport/ExtendViewport.java
As far as I can see, there does not seem to be a similar implementation for MonoGame.Extended available. Have I overlooked something, or is there perhaps desire for such a viewport implementation?
Seeing as I need it either way, I wouldn't mind sharing what I come up with if it's not available yet!
What is this kind of viewport used for?
Generally speaking I feel that LibGDX and MonoGame.Extended have a lot of similarities so it does feel like it might be a good fit into our library.
First things first though, like @stefanrbk I'd like to understand better what this kind of viewport is used for in the real world. Do you happen to have a screenshot or an example of a game that uses a viewport like this?
I don't know if this implementation came first with Unity or GDX, but in Unity it's used a lot to have a display that's both not letterboxed and not disproportionately scaled. The GDX version behaves, to my experience, the very same.
I have used it in the UI and in the game for Curse of Aros: https://www.curseofaros.com
The idea is that instead of keeping the world units fixed, you allow them to bleed beyond (almost like how the Boxing impl does it, but different). Results in scaled but not disproportionate UI's and game worlds that look both good on the (silly big) iPhone XR and an Android 4:3 screen from 1962.
Hope that helps!
Which.. now leads me to a question (or more of a curiosity): since this implementation did not exist, how does one normally with MG or MG.E make user interfaces (or game worlds) that are not letterboxed but are nicely scaled (so that those phones with massive resolutions don't have interfaces for ants)?
I gave it a shot to port it to MonoGame, so if you'd like to try the (sloppy) conversion and see what it does:
https://gist.github.com/Velocity-/85478568d95fd81509a6ad64f7048bad
The end of the URL warns you; I don't speak C# well.
There are a few ways to do it and I think what you are looking for is what our viewports do, but a lot of screen things like viewports are kinda broken on Win10 right now. MG doesn't get the message when windows resize under certain circumstances, so once that is fixed the current functionality may function like what you are talking about.
I would like to investigate more in-depth and do a refresh for the viewport adapters. One good example is to look at Nez for how they do screen resolution.