Forum rules - please read before posting.

Problems with minimum aspect ratio

Loving the inclusion of a minimum aspect ratio in the new release!

It doesn't seem to work perfectly though - here's what I get with a minimum aspect ratio set to 1.9 (I'm using a background sprite to set the screen limits):
https://1drv.ms/u/s!Amz_vh8OYDX3vNhV0SUQysFViDcTOQ?e=uGI5Pt

What I would expect to see:

  • The camera to move to the right so than no blue background is shown
  • The overlay menu to be forced down along with the letter boxing

To be able to specify a maximum aspect ratio would be FANTASTIC, but I'll do a separate post on that not to clog up the thread :)

Comments

  • Are you getting the "expected" behaviour if the aspect ratio is instead fixed?

    The overlay menu prefab needs to have an Auto Correct UI Dimensions component configured to work with AC aspect ratios - is this the case, and how is it set up?

  • Yes, the same thing using fixed as when using minimum.

    Ah, did not know about the AutoCorrectUIDimensions component - that works!

  • Try this fix. Open up GameCamera2D and find the code block:

    Vector3 bottomLeftWorldPosition = Camera.ViewportToWorldPoint (new Vector3 (0f, 0f, Camera.nearClipPlane));
    Vector3 topRightWorldPosition = Camera.ViewportToWorldPoint (new Vector3 (1f, 1f, Camera.nearClipPlane));
    

    Replace it with:

    Rect rect = Camera.pixelRect;
    Camera.pixelRect = KickStarter.CameraMain.pixelRect;
    Vector3 bottomLeftWorldPosition = Camera.ViewportToWorldPoint (new Vector3 (0f, 0f, Camera.nearClipPlane));
    Vector3 topRightWorldPosition = Camera.ViewportToWorldPoint (new Vector3 (1f, 1f, Camera.nearClipPlane));
    Camera.pixelRect = rect;
    
  • That fixes it! 👍

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.