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

Max Title not always followed on the imported sprite

Discussion in '2D' started by ironfiftynine, Feb 9, 2015.

  1. ironfiftynine

    ironfiftynine

    Joined:
    Jan 22, 2013
    Posts:
    69
    I have large sprites in my game that I reduce in dimensions by assigning the Max Size property in the sprite inspector. For example my 437 x 512 sprite becomes 109 x 128 if I assign 128 as the max size (as displayed in the inspector). However I have some sprites that won't change even though I adjusted the said property like my 512 x 52 sprite which will not shrink even if I assign 256 as its max size. Is there a particular condition that I should check for it to work? Thanks in advance. :)
     
  2. Chris-Trueman

    Chris-Trueman

    Joined:
    Oct 10, 2014
    Posts:
    1,256
    Don't use the Max Size property to "scale" your sprites. That is for compression and you want it to be at the sprites native size. I would make your sprites the size you want with your editor and avoid having to scale them in game.

    For 2D I create a sprite sheet with all my graphics on one texture. Mobile doesn't like to switch textures very much so its better to use as few as possible. Having 1 big texture takes up less overhead than 20 smaller ones that will fit in the big texture. Also having the textures power of 2 may help.

    Hope that helps you in the right direction.
     
    theANMATOR2b likes this.
  3. ironfiftynine

    ironfiftynine

    Joined:
    Jan 22, 2013
    Posts:
    69
    Thank you for the response. I'll clarify my setup. I'm actually using NGUI for my UI Sprites. My main aim for adjusting the Max Size would be to reduce the dimensions of the NGUI atlas. I'm asking this in the Unity forums because the Max Size is a built in function of the Unity and I would like to know why it behaves in such a way.
     
  4. Chris-Trueman

    Chris-Trueman

    Joined:
    Oct 10, 2014
    Posts:
    1,256
    Max Size should resize the texture to the size specified if it is larger than the max size. You would use it to limit a textures size on a specific platform like Android to have a max size of 2048 so it is a size that is supported. I don't think it was intended for it to resize a texture in the way you are trying to use it. I would resize it in an editor then re import it.
     
  5. ironfiftynine

    ironfiftynine

    Joined:
    Jan 22, 2013
    Posts:
    69
    Hmmm but according to Unity Manual ( http://docs.unity3d.com/Manual/class-TextureImporter.html )
    Max Texture Size - The maximum imported texture size. Artists often prefer to work with huge textures - scale the texture down to a suitable size with this.

    And I prefer to keep it that way since it's more flexible to adjust for different build settings, so I thought setting the Max Size would be faster to do. And my image was larger than the max size. Like what I said I tried it with my 512 x 52 to shrink it to 256 pixes in width. Anyway, I guess the last option is to edit the raw image itself like what you said. Again thanks for the response.

    P.S. I'm leaving this thread open just in case there's someone who is willing to explain the behavior in Max Texture Size. Thanks!