Search Unity

Android GUITexture Pixel Inset Height- incorrect?

Discussion in 'Android' started by Clamps, Oct 2, 2011.

  1. Clamps

    Clamps

    Joined:
    Nov 7, 2009
    Posts:
    220
    Hi all,

    I'm building to a Galaxy S 2. Screen res of 800x480
    However if I want to use GUITexture to place a texture to appear on the screen, I need it to be 800 x 384 to be pixel perfect. Otherwise it stretches off the screen.

    Does anyone know if there's something I'm doing wrong here?

    Thanks,

    Clamps
     
  2. Clamps

    Clamps

    Joined:
    Nov 7, 2009
    Posts:
    220
    My description of the problem might not show th real problem.
    I'm attaching two images.
    The first image is the original. It is 800x480, and I've marked a 2 pixel line at 50 pixels down to show how cut off it is.
    The settings I used to import it are:
    Default for everything *except* "Texture Type". I set that to "GUI".

    Then I made a GUITexture, and used the default settings that Unity made when the GUITexture was created.
    Pixel Inset
    X -400
    Y -240
    Width 800
    Height 480
    all borders at 0.

    The second image is the screenshot of that image, taken from my Android Galaxy S2.

    I hope it's clear to someone else what the problem is.

    Thanks,

    Clamps
     

    Attached Files:

  3. Clamps

    Clamps

    Joined:
    Nov 7, 2009
    Posts:
    220
    It turns out that I can force the texture to appear correctly on the screen by setting the Pixel Inset to the following settings-
    X -400
    Y -192
    Width 800
    Height 384
    all borders at 0
     
  4. Clamps

    Clamps

    Joined:
    Nov 7, 2009
    Posts:
    220
    Does anyone have any insight into this?