Author Topic: Help! Can't change sprite dimensions or borders in v2.2.0 (works in free 2.0.7)  (Read 9954 times)

Tom G

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Hi,

Today I purchased NGUI v2.2.0 after being impressed with the free trial previously. Unfortunately, as soon as I started using the new version I found myself unable to do something pretty fundamental: change the Dimensions and Borders on a Sprite, in the UIAtlas inspector. In the old version, I just type a number into the green or blue boxes and it's done.  In the new version, the boxes always reset their values, no matter what I do.

I have tried restarting Unity. I have tried creating new Scenes.  I have even re-downloaded the whole of NGUI into a brand new Unity project, and it still won't work.  As soon as I downgrade to 2.0.7 (free), it works again.

I went in the UIAtlasInspector code to trace out some values, and it seems that for every one pass of the OnInspectorGUI which attempts to modify the green and blue values (Rect outer and Rect inner) there are then four or more passes triggered which all reset these Rects to their 'locked' values.  It's like it is always failing validation, and then being repeatedly pummelled back into its old values.

Please help -- I thought long and hard about this purchase and now I am very definitely in negative value for money!!  :-[

Thanks,

Tom

PhilipC

  • Guest
Hi Tom,

We do know about this issue and Mike has already posted a fix for it here http://www.tasharen.com/forum/index.php?topic=1670.0. I'm sure that as soon as Mike is back he will release a new version with the fix.

Sorry for your frustration.

Tom G

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Thanks Phil,

The fix appears to work to some extent, in that it now allows me to change Borders (and so I can create a Sliced Sprite from an image) but I'm still seeing funky behaviour with the Dimension fields (the green ones) which won't budge, meaning I can't create multiple regular Sprites from one Atlas.  I'm completely new to NGUI, but I'm pretty sure that this should be possible!

I appreciate you're probably working hard to fix this, but I thought I'd let you know in case this was in fact a separate issue.

Cheers  ;)

Tom G

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
OK - the temporary fix I'm using involved adding "mSprite.outer = outer;" after line 283 of the modified version of UIAtlasInspector.cs.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Here is the updated inspector script that will live-update the changes properly.

I will update the Asset Store / direct download versions when I get home (tomorrow). Still at Unity HQ for the time being...

Tom G

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Amazing.  Thx.  Have fun at Unity!

Martin Schultz

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 37
    • View Profile
    • Decane
I tried the hotfix, but changing the border doesn't work. Not live updating nor having any effect here.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Are you sure you placed it in the right spot?

Martin Schultz

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 37
    • View Profile
    • Decane
I take it  back, for some reason the old file stayed in ngui/scripts/editor. It works proper. Sorry for the confusion.

athos

  • Guest
Using v2.2.1 downloaded from the asset store. Atlas padding doesn't work. Looks like this code is incorrect.

  1. mSprite.paddingLeft     = a.x / mSprite.outer.width;
  2. mSprite.paddingTop      = a.y / mSprite.outer.width;
  3. mSprite.paddingRight    = b.x / mSprite.outer.height;
  4. mSprite.paddingBottom   = b.y / mSprite.outer.height;
  5.  

Should be:
  1. mSprite.paddingLeft     = a.x / mSprite.outer.width;
  2. mSprite.paddingTop      = a.y / mSprite.outer.height;
  3. mSprite.paddingRight    = b.x / mSprite.outer.width;
  4. mSprite.paddingBottom   = b.y / mSprite.outer.height;
  5.  

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Hmm... wonder what happened there. I'll fix it, thanks.

TokyoDan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 53
    • View Profile
This problem is back I can select the "Sliced" drop-down menu item from Sprit Type in the Inspector but the handles that allow you to adjust the edge margins do not appear.

This problem showed up in last version of NGUI Pro before that last update. And I just updated today to the latest version in the Asset store but it doesn't fix the problem. And I on Unity 4.2.1 which I updated to a few weeks ago.

I think Unity 4.2.1 may have broke NGUI sliced sprites because the last time i made sliced sprites they were OK and I was on Unity 4.1.x.
----------------------
Please disregard the above. I was doing it wrong. If anyone has the same problem here is the way to do it right:

http://www.tasharen.com/forum/index.php?topic=5669.msg26900#msg26900
« Last Edit: September 17, 2013, 12:46:16 AM by TokyoDan »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Handles only show up when you have them enabled via the NGUI menu, and when you're using the move tool (W).

NGUI 3.0 has been tested on Unity 3.5.7, 4.2.1, 4.3, and 4.X :)