So I am building a game using Adventure Creator and the process has been fairly great so far! However one thing I've come across that I'm a bit stumped on is how do I go about changing the camera's min and max X and Y variables depending on resolution?
Currently the resolutions I am targeting are 16:9 and 4:3. When I set a min and max for 4:3 aspect ratio it obviously doesnt work for 16:9 with the same values. Any ideas on how I can go about having one unified min and max for each aspect ratio?
Comments
I suppose you are scaling the view (camera ortho size) to fill the native height without letterboxing.
But I would use the same limits and scale until the width fill the render window, instead of height. That way, with the same width you can use only one camera min/max. If you want you could use horizontal black bars for 4:3, use that space for your inventory or... like a safe frame, just have more not meaningful room/background.
If you need to change the camera min/max, I think you could use different cameras each own with its limits, but you can't ask the aspect ratio through actionlist so it can't be dynamically setup without code.
AC.KickStarter.settingsManager.wantedAspectRatio
If your game's resolution gives you a different aspect ratio to the one supplied here, borders will appear as appropriate. If you want to have an "aspect ratio" setting in e.g. an Options menu, take a look at this tutorial. That method involves linking your custom option to a global variable - checking it's value would be easier to do in ActionLists. You might want to have a pair of navigation cameras, and set the correct camera based on the variable's value.