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 - greyhoundgames

Pages: [1] 2 3
1
NGUI 3 Support / Problems with UILabel
« on: September 14, 2015, 02:58:59 PM »
I recently hit the following bug(which is very confusing because I am pretty sure I have sucefully generated fonts since I updated to Unity 5)

http://www.tasharen.com/forum/index.php?topic=12001.0

Ok so I took the route of using a tool to generate fnt files(the web based one linked) and made my fnt file. I went into the atlas make and selected the import option. Selected fnt, selected texture, go. Everything seemed fine. However labels set to use this draw nothing. I also noticed that the prefab that was created was only 1k and basically was empty. This seemed wierd.

Thoughts?

[Update] I tried the 32 bit version of unity and it still does not work. Here is the error it produced(which is not the same error). I downloaded a fresh copy of NGUI into a new project just to be sure it wasnt due to having installed a 64bit plugin

Failed to load 'Assets/NGUI/Editor/FreeType64.dll', expected 32 bit architecture (IMAGE_FILE_MACHINE_I386), but was IMAGE_FILE_MACHINE_AMD64. You must recompile your plugin for 32 bit architecture. You have the following:
#if UNITY_4_3 || UNITY_4_5 || UNITY_4_6
               string filename = (Application.platform == RuntimePlatform.WindowsEditor) ? "FreeType.dll" : "FreeType.dylib";
#else
               string filename = (Application.platform == RuntimePlatform.WindowsEditor) ? "FreeType64.dll" : "FreeType64.dylib";
#endif
However there is a 32 bit unity 5. Changing this did not fix my problem, even with a restart.

[Update2]
Going back to Unity4.6, it still does not work.
On windows for either unity 5 or 4 when you drag the ttf font into the generate font field it does nothing, on mac it spits up the error about easyfont
On both for using import font there are no errors but labels produce nothing and the prefab is super tiny.

2
From what I have seen when you have based-on-height aspect ratio the left and right anchors work, they just basically effect the center which is perfectly fine. My only issue was the anchors not updating. I believe there is more going on here because the sprite who I am changing things on is a child of the guy who's anchors are not working. So B in this case is not having any modification done to it, but its dimensions get stuck at 2x2 when c's sprite changes. I tried the broadcast technique on both A and B and C but it did not help

3
Situation. I have Widgets A, B and C nested in each other in that order
B is anchored to A flush with its sides. C is anchored to B, a percent of its size

Everything works correctly with my setup until I call this code
  1.         sprite.spriteName = newSpriteFrameName;
  2.         UISpriteData spriteData = sprite.atlas.GetSprite(newSpriteFrameName);
  3.         sprite.aspectRatio = (float)spriteData.width / (float)spriteData.height;
  4.         sprite.Update();
  5.  

I have tried calling UpdateAndResetAnchors on B and C but it did not help. If I poke at the anchors while the thing is running, eventually it figures out what it was supposed to do. Thoughts?

4
Hello again. Hope you are not sick of my bug reports :) It just means we are using your product a ton :)
Here is a sample of my font where all I am doing is pressing the +1 transparent border button. It is a 64 point font that ended up at 2048x2048 texture size.
Don't mind the different image sizes, I just took a screen shot at slightly different zooms. You can see the transparency decays. It also got yellow if i added more and more padding.

It turns out, I think, that this is caused by running the padding command while the image is in PVR mode. Switching it to true color, and then doing the padding and then switching back solved the problem.

So this is pretty minor if you know how to fix it, and pretty annoying if you do not :)
On a side note, I had to add 3 padding spaces to get rid of crud on all the letters. Not sure why but likely related to a 64 point font being shown at a small font point and the downscaling algorithim.

5
I had about 100 prefabs with labels that were all TTF fonts. I dropped them all in, in the filter box i typed in UILabel. Then with them all selected I clicked on the font type box and changed it to NGUI.

Then I applied all the prefabs.

How I noticed this problem in the first place is that the default font size # was showing 25 which was the UILabel.fontSize variable value instead of 64 which was the NGUI font file size.

Thats when i put a breakpoint in the UILabelInspector class and saw that the default font size getter was determining that the ttf font was not null and returning the font size itself.

6
I have about 2 billion labels, so hoping this can be fixed in the code :)

7
I had a TTF label that I made into a NGUI font label. I noticed there were some sizing problems. When i debugged into the code I saw that it was doing null checks on the ttf font which must still have been set in the serialization. Hence it got the default font size wrong. The label was experiencing some other incorrect behavior which I am hoping is related to this as well.

8
NGUI 3 Support / Re: Notifications with arguments in Il2CPP
« on: April 29, 2015, 02:36:10 PM »
It was the on drag notification which i was passing the value of the bar. I just removed that and fetched the value myself and it was fine after that.

9
NGUI 3 Support / Memory Leak found in NGUI so it seems
« on: April 23, 2015, 11:49:15 PM »
Our project is almost done! OMG 1.5 years. Loving NGUI every day of it. Ok enough compliments. We are in the memory\performance tuning point of this sucker.

If i run on device(even on windows it does this) I can detect orphaned game objects in the scene. The  number of them grows consistantly, after just 2 level changes I had 44 of them. They do not go away on a scene change. I went back to a "rest" scene that is mostly empty and printed out debug info on them. Here is what I was able to get. I was able to find these using the unity profiler, taking a memory snapshot and looking in the GameObjects section of Scene Memory, there it lists them all as being named "New Game Object"

I am setting their  name so I can tell them apart, then printing their children, parent and components.
DEBUG: Named Him:Found:44, active=True parent = null child count = 0 children = components=,Found:44-UIDrawCall

You can see here that its a root game object who has a component inside of him that appears to be himself???? That's really strange... The type was UIDrawCall

The code I used to find this is:
  1. GameObject[] gos = Resources.FindObjectsOfTypeAll<GameObject>();
  2.  
  3.  
  4.  
  5. public void DescribeGameObject(GameObject go, int count)
  6.     {
  7.         go.name = "Found:" + count;
  8.         string childrenNames = "";
  9.         for (int i = 0; i < go.transform.childCount; i++)
  10.         {
  11.             childrenNames = childrenNames + "," + go.transform.GetChild(i).gameObject.name;
  12.         }
  13.         string componentNames = "";
  14.         foreach (Component c in go.GetComponents<MonoBehaviour>())
  15.         {
  16.             componentNames = componentNames + "," + c.name+"-"+c.GetType().Name;
  17.         }
  18.         Utils.DebugLog("Named Him:"+go.name+", active=" + go.activeInHierarchy + " parent = "+((go.transform.parent == null) ?"null":go.transform.parent.name)+" child count = " + go.transform.childCount + " children =" + childrenNames + " components=" + componentNames);
  19.     }
  20.  

If this is already fixed, I apologize. I am somewhat up to date, my NGUI version is 3.8. This seems like a pretty serious issue as in only 3 levels I had 44, and just a few minutes of the game running. Imagine if it ran for an hour....

10
NGUI 3 Support / Notifications with arguments in Il2CPP
« on: April 22, 2015, 04:47:22 PM »
I have lots of notifications in my NGUI usage like button clicks etc.
I noticed on IL2CPP a UIProgressBar notifiation which gives the value as an argument is throwing a no AOT compiled error.
Has anyone used arguments in notification sucesfully? Changing it to be a plain notification removed the problem.

Thanks!

11
NGUI 3 Support / Particles in Unity 5
« on: April 08, 2015, 04:49:18 PM »
So I used a workaround I found that puts particles infront of NGUI. I add a component that does this:
  1.         Renderer ren = GetComponent<Renderer>();
  2.  
  3.         if (ren == null)
  4.         {
  5.             ParticleSystem sys = GetComponent<ParticleSystem>();
  6.             if (sys != null) ren = sys.GetComponent<Renderer>();
  7.         }
  8.  
  9.         if (ren != null)
  10.         {
  11.             mMat = new Material(ren.sharedMaterial);
  12.             mMat.renderQueue = renderQueue;
  13.             ren.material = mMat;
  14.         }
  15.  

It was working fine, but I noticed it now no longer works. I am wondering if its related to upgrading to Unity5.
Things I have tried:
In the particle system itself, change the render layer field(new to unity 5 perhaps?)
Make a panel just for the particle and put it at a higher render priority http://www.tasharen.com/forum/index.php?topic=7216.0
The originally mentioned code
Another person's component based solution
  1. int rq = widgetBehindMe.drawCall.renderQueue + 1;
  2. foreach (Material material in m_renderer.materials)
  3. {
  4.   material.renderQueue = rq;
  5. }
  6.  

None of these seem to work for me anymore.
Thoughts?

12
NGUI 3 Support / Re: Garbed Text Shortly After Load
« on: March 12, 2015, 09:44:31 PM »
Whats your suggestion for handling Japanese etc with massive # of symbols as far as bitmap fonts go?

13
NGUI 3 Support / Re: Garbed Text Shortly After Load
« on: March 12, 2015, 03:03:07 PM »
Has there been an update on this? We are seeing this after we upgraded from unity 4.5 to unity 5. Its reliably reproducible by loosing focus on the unity window and coming back.

We can try to submit something but just curious if something has happened lately.

Thanks!

EDIT It actually editing a file. When it saves the text vanishes, and when there is a problem(like an error), it doesn't come back until something triggers an update. This could imply it won't happen in production...

14
I don't think this is the problem. I see this also on smaller anchors not > 1 and putting in the unclamped lerp function as such
  1. public static float LerpUnclamped(float from, float to, float value)
  2. {
  3.    return (1.0f - value) * from + value * to;
  4. }
  5.  

and

  1. public void SetVertical (Transform parent, float localPos)
  2. {
  3.   if (rect)
  4.   {
  5.     Vector3[] sides = rect.GetSides(parent);
  6.     float targetPos = LerpUnclamped(sides[3].y, sides[1].y, relative);
  7.     absolute = Mathf.FloorToInt(localPos - targetPos + 0.5f);
  8.   }
  9.   else
  10.   {
  11.     Vector3 targetPos = target.position;
  12.     if (parent != null) targetPos = parent.InverseTransformPoint(targetPos);
  13.     absolute = Mathf.FloorToInt(localPos - targetPos.y + 0.5f);
  14.   }
  15. }
  16.  

Did not solve the problem

15
This may only be for anchors over 1.0 but for example here are some values I have and what the code below provided as answers:

UIRectEditor
float final = Mathf.Floor(0.5f + Mathf.Lerp(0f, f1 - f0, rel.floatValue) + abs.intValue);

Top anchor:Custom
Relative=1.204429 Absolute = 19

After pressing Set To Current Position
Relative = 1.09379 Absolute = 0;

Height of anchored To object = 177

So you can tell that its exactly backwards, it should have increased to 1.31177


Further notes. Its not just anchors over 1. Normal anchors are also moving when you do set current position. I debugged into this code line above and f0,f1(which I understand to be the sides of who you are anchored too) have values which seem incorrect
Position =190.985,89.81001
Dimensions
284x177
Bottom side should then be 89.81 - (177/2) but instead of coming out with ~1 the bottom is shown as -194
Top side should then be 89.81 + (177/2) but instead of coming out with ~177 the topis shown as 4

Pages: [1] 2 3