Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: kruncher on December 12, 2013, 05:15:17 PM

Title: Heads Up! "Sprite is not rectangle-packed" exception
Post by: kruncher 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 :)