Forum rules - please read before posting.

Handling Multiple Resolutions

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

  • Are you working on 2D?

    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.
  • MaaS, I am working in a 2D environment.

    So, to clarify, you want me to scale the orthographic size property on the camera until the min and max work for both?

    I guess the other thing I could do is create a custom action that checks the Aspect Ratio and then have it so that you can pass in a Min and Max to the Action. I could have that action run OnStart and set the Min and Max depending on the Aspect Ratio.

    Of course that all depends on whether that is accessible or not through code.
  • edited April 2015
    @Rocco, if you're forcing the aspect ratio in the Settings Manager, you can retrieve it, and set it, through script with:

    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.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.