Author Topic: Heads Up! "Sprite is not rectangle-packed" exception  (Read 5407 times)

kruncher

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 78
    • View Profile
Heads Up! "Sprite is not rectangle-packed" exception
« on: December 12, 2013, 05:15:17 PM »
Just a little heads up in case others experience this exception!

The default packing setting for Unity 4.3 sprites is "tight" which means that you cannot use Sprite.rect to calculate the sprite UVs:
  1. UnityException: Sprite is not rectangle-packed. TextureRect is invalid.
  2. UI2DSprite.get_uvRect () (at Assets/NGUI/Scripts/UI/UI2DSprite.cs:181)
  3. UI2DSprite.OnFill (.BetterList`1 verts, .BetterList`1 uvs, .BetterList`1 cols) (at Assets/NGUI/Scripts/UI/UI2DSprite.cs:241)
  4. UIWidget.UpdateGeometry (Boolean visible) (at Assets/NGUI/Scripts/Internal/UIWidget.cs:1163)
  5. UIPanel.UpdateWidgets () (at Assets/NGUI/Scripts/UI/UIPanel.cs:980)
  6. UIPanel.LateUpdate () (at Assets/NGUI/Scripts/UI/UIPanel.cs:874)
  7.  
Until the "tight" UV data is exposed, people will need to manually set "Mesh Type" (using the texture importer of their sprite) to "Full Rect". This resolves the issue :)