Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Understand Camera/View Game

Discussion in '2D' started by bali33, Jun 15, 2014.

  1. bali33

    bali33

    Joined:
    Aug 14, 2011
    Posts:
    232
    Hi guys,

    I have one png file which is about 1024x768 pixels in the center of my scene
    The Camera size is 5
    The Game view is set-up to Standalone 1024x768

    With this set-up my png does not fill all the screen, it is centered but there is margin in left, top, right and bottom - I can't understand why.

    How does it works ?

    Thank you
     
  2. WidmerNoel

    WidmerNoel

    Joined:
    Jun 3, 2014
    Posts:
    59
    Sorry, my last answer was off topic I think.
    Well, in the sprites import settings you will find a property called PxToUnits. This is set to 100 by default.
    That means your sprite has a size of 10.24U x 7.68U.
    The camera is set to 5 as you said, that means the view will show 10 (5*2) Units in its height.

    I guess you probably have a margin of 1.16U (((5 * 2) - 7.68) / 2) at the top and bottom.

    have a look at this:
    http://forum.unity3d.com/threads/orthographic-screen-size.113641/
    it helped me a lot lately :)
     
  3. bali33

    bali33

    Joined:
    Aug 14, 2011
    Posts:
    232
    Thank you !