Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - terence

Pages: [1]
1
NGUI 3 Support / Fonts fuzzy (fixed)...2.6.2
« on: June 16, 2013, 10:11:06 PM »
Hi,

If your fonts go all fuzzy on you with the latest update(like it did to me), just make sure your font text isn't being compressed (i.e. click on your font atlas) and set it to Advanced/Non Power of 2/No mip maps/Clamp/Bilinear ..override for iPhone(other devices) to RGBA 16 bit.

I also went ahead and changed the shader for the material to dynamic font. Not sure if that's the right thing to do but it made sense.

Sharing is caring..;P

2
NGUI 3 Support / ??? appear on pivot on sprites/labels etc
« on: June 11, 2013, 11:03:57 PM »
Just wondering why ??? are appearing instead of text on the inspector windows. Using latest NGUI 2.6.2

3
Yes. I know that, but I am just pointing out that the NGUITools.SetActive should still work consistently across Unity3.5 and Unity 4..

I should either be included as a fix for the current build or improved upon so it does work consistently.

4
This is how i 'fixed' it...in NGUITools..
  1.         static void Activate (Transform t)
  2.         {
  3.                 SetActiveSelf(t.gameObject, true);
  4.  
  5.                 // Prior to Unity 4, active state was not nested. It was possible to have an enabled child of a disabled object.
  6.                 // Unity 4 onwards made it so that the state is nested, and a disabled parent results in a disabled child.
  7. #if UNITY_3_5
  8.                 for (int i = 0, imax = t.GetChildCount(); i < imax; ++i)
  9.                 {
  10.                         Transform child = t.GetChild(i);
  11.                         Activate(child);
  12.                 }
  13. #else
  14.                 // If there is even a single enabled child, then we're using a Unity 4.0-based nested active state scheme.
  15.                 /*for (int i = 0, imax = t.GetChildCount(); i < imax; ++i)
  16.                 {
  17.                         Transform child = t.GetChild(i);
  18.                         if (child.gameObject.activeSelf) return;
  19.                 }*/
  20.  
  21.                 // If this point is reached, then all the children are disabled, so we must be using a Unity 3.5-based active state scheme.
  22.                 for (int i = 0, imax = t.GetChildCount(); i < imax; ++i)
  23.                 {
  24.                         Transform child = t.GetChild(i);
  25.                         Activate(child);
  26.                 }
  27. #endif
  28.         }
  29.  
  30.  

Pretty much commented out the check which pops out of the method if it finds any 'active' children. The only thing that comes to mind is that some how an active child was found when there shouldn't be..

5
I noticed this:
http://www.tasharen.com/forum/index.php?topic=2283.msg11378#msg11378

and also notes in the build about fixes, but it still doesn't work right for me because when I call NGUITools.SetActive, many of my widgets child objects (i.e. labels, sprites etc) don't get activated. I just update to 2.3.6 and the problem is still there.

If it matter any, the panel starts out disabled (i.e. all elements disabled).

6
Hrumph...nevermind...I was forgetting to Broadcast CheckParent...to all the children.

7
I am implement a series of dragabble object(Sprite + Labels) that are in a draggable panel (with a soft clip). When I drag the object out, i parent it a panel with no clipping. However when I do so, the object is still being clipped.

The following is the hierachy:
   DeploymentView(UIPanel)(z is 0)
   > Deployable(UIPanel with clipping, UIDraggablePanel) (z is -1)
   >>Mechs(UIGrid) (z is -1)
   >>>Mech 1(UIDraggable Object) z = 0
    >>>Mech 2(UIDraggabel Object) z = 0

   DeployedView(UIPanel) <- objects parent to this when 'dragged out' (z is -3)

I notice even after I parent the object to the panel, the 'materials' don't appear under the Deployed panel (unlike the drag/drop example 11).

Is there a step i'm missing?

8
NGUI 3 Support / Get RGB/Color values from a sliced sprite
« on: January 29, 2013, 03:45:28 AM »
Thinking of doing a simple skin tone picker and I need to grab the RGB color values from different sliced sprites. Would I access the Sprite Atlas as a texture. How would I get the sliced sprite coordinates?

9
NGUI 3 Support / Re: UIAnchor widgets poping into place?
« on: January 20, 2013, 10:14:57 PM »
I added an 'Update' to the Start function in UIAnchor. It doesn't seem to help.

This is only happening the iOS device(iPhone5).

10
NGUI 3 Support / UIAnchor widgets poping into place?
« on: January 18, 2013, 06:57:02 AM »
I am using NGUI 2.2.7.

I've implemented an app using UIAnchors to position my widgets to cater for multiple ios resolutions. The problem I am having now is that when I load between Scenes, the widgets seems to noticeably 'pop' into place. I am using a very simple 2D UI.

11
NGUI 3 Support / Fix for UISpriteAnimation bug...
« on: November 21, 2012, 07:46:32 PM »
UISpriteAnimation has a bug where it calls makePixelPerfect after setting the sprite. Obviously if you resized the sprite that would cause problems. So to fix it I added an member variable to enable/disable this. Not sure if should post the fixes but here are the code portions.

UISpriteAnimationInspector line 54 onward
  1.                 bool makePixelPerfect = EditorGUILayout.Toggle ("Make Pixel Perfect",anim.makePixelPerfect);
  2.                
  3.                 if (anim.makePixelPerfect != makePixelPerfect)
  4.                 {
  5.                         NGUIEditorTools.RegisterUndo("Sprite Animation Change", anim);
  6.                         anim.makePixelPerfect = makePixelPerfect;
  7.                         EditorUtility.SetDirty(anim);
  8.                 }
  9.  

UISpriteAnimation
  1.         [HideInInspector][SerializeField] bool mMakePixelPerfect = true; // Line 21
  2.  
  3.         public bool loop { get { return mLoop; } set { mLoop = value; } }
  4.        
  5.         public bool makePixelPerfect { get { return mMakePixelPerfect; } set { mMakePixelPerfect = value; } } // Around Line 54
  6.  
  7.         // Around Line 88
  8.         if (mActive)
  9.         {
  10.                 mSprite.spriteName = mSpriteNames[mIndex];
  11.                 if (mMakePixelPerfect)
  12.                     mSprite.MakePixelPerfect();
  13.                 }
  14.        
  15.  
  16.  

Hope this make it into the next build..;P

12
NGUI 3 Support / Re: So you want to make health bars...
« on: October 09, 2012, 01:23:47 AM »
I've been to trying to get a floating health bar on a 3D object to work right. I followed the code in this discussion but the results are less then satisfactory. The UISlider seems to float around the 3D object rather than staying in place.

Info:
1) I am using a simple 2D U. Should I switch to a 3D UI and attach the widgets to my 3D object with a face camera script?
2) I am attaching the uislider to parent to the panel->anchor->camera->uiroot(2d)

Attached some images that might help explain thing. The first is my ui hierachy. The second is the picture of the initial position of the uislider and the third when i have moved the game camera around to the left. It seems to uislider widget seems to float around the object and not stay exact.

13
NGUI 3 Support / Re: Switch between cameras in game
« on: April 16, 2012, 03:45:15 AM »
Hmmm..not sure if I get you..Right now my Hierachy looks like this:

Cameras (Only 1 active)
->Main Camera
->Mouse Orbit Camera

UI Root(2D)
->Camera
-->Anchor
--->Panel
-----><Uis>

when I switch between the main camera and the mouse orbit camera, the UI dissapears (I am assuming that there is some late binding happening between the UI camera and the main camera).

14
NGUI 3 Support / Switch between cameras in game
« on: April 16, 2012, 01:39:00 AM »
I am using a simple 2D UI but I need to have multiple in game camera (i.e. I deactivate the main camera, set another camera for conversations etc). Right now when I 'switch' camera, the UI goes with it. Can I get the Ui to use the new camera setup?

Pages: [1]