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.


Topics - greyhoundgames

Pages: [1] 2
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
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?

3
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.

4
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.

5
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....

6
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!

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

8
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

9
This happens every so often, and eventually with enough fidgiting it goes away. It would be nice to get a better understanding of what causes this to make it easier to fix in the future.
I have a ngui root with a panel on it. I anchor something to its edges. The anchored child has size of 2x2. I do this all the time in my code and it mostly always anchors the children to the screens dimensions. However sometimes I get it stuck like this where it cannot find the panel's size.

I saw a post where Aren said that you need culling otherwise a panel is just a boundless object. However none of my panels that work correctly have culling. So I believe the problem is something else.

If i make a new 3d root, switch it to perspective, and anchor the child into that panel, it works fine. Comparing the inspectors I cannot see a difference on the panel objects or root objects

A Note: I tried to save this as a prefab, move to a new project, and paste it so i can upload it for you. However after doing that it fixed itself. Then after coming back to the original project it was fixed there too. Must be a cached bug of some kind.

10
NGUI 3 Support / ColorTween fighting with UIButton script
« on: February 05, 2015, 01:15:04 PM »
Often I want to control color tinting on something. However if that something has a UIButton on it, it grabs control of that for mouseover etc. This occurs even if I set to the tween target to null because it re-establishes the tween. I understand why its doing what it is doing, but it might be nice to have a way to tell the button to not touch the tweens.

Any suggestions?

11
Consider a common case of a box with a stat icon in it. If you set the stat icon to be anchored to the box, and give it a basedOnWidth\height aspect ratio, as the box grows in a single dimension, the icon will either ignore it(ok, or grow with it spilling over the side in the other dimension). Is there a way to have something like size based on minimum of both width and height. Or an ability to put a sprite on free aspect ratio but then making the actual render be aspect ratio dependant still?

See the example for boxes with icons in them. The icons are set to based on width aspect ratio. As the box gets wider, the icons spill over the top.
Desired would be for them to respect both the width and height without getting distorted.


12
NGUI 3 Support / Relative anchors greater then 1 causing editor bugs
« on: January 07, 2015, 05:08:28 PM »
So in the past I could set anchors greater then 1.0 as a relative anchor in the editor. Like to get 4 buttons in a row i could anchor 3 of them to the left most one and have their positions be 1.1, 2.2, 3.3 etc and they would space out nicely. I recently updated my NGUI from a version circa 5 months ago and now when I try to enter any value greater then 1, the editor textfield greys out and refuses to let me edit it. It still works when you do this programatically.
  • add some widget
  • add another widget anchored to it
  • change the left anchor to current position
  • type in 1.5 and see if it greys out for you.

Any input would be appreciated.

13
NGUI 3 Support / atlas sprites with padding scaling improperly
« on: December 19, 2014, 11:19:58 AM »
Scenario: You have some round button with content that bleeds over the top edge in the png file. You add blank white area below the circle to make the image's actual center the middle of the circle.

Step 1 Import the sprite into an NGUI atlas. NGUI trims off the transparency and adds a padding entry so that it can correctly center it back
Step 2 Snap to the right size and then lock the aspect ratio by setting size based on height
Step 3 Make the sprite smaller then the original art size

Result: The padding amount remains fixed as the image scales down, causing your image to get off centered
Desired: A percentage of the padding should be used based on the image sized compared to original art size.

14
NGUI 3 Support / NGUI context menu missing in latest Unity
« on: July 21, 2014, 11:52:45 AM »
Me and my coworker are using the same git repo. I updated unity(the one that just came out a few days ago) and he did not. Otherwise they are identical. I have lost my NGUI context menus.
Anyone else seeing this?

15
TNet 3 Support / Peer to Peer and mobile devices
« on: July 07, 2014, 05:31:03 PM »
Does anyone know how mobile devices work with peer to peer setups?
Can you use a server just to pass out opponent's IP addresses and then have a phone connect directly to another phone? TNET supports UPNP but do phones have UPNP or even need it? I am unsure of what kind of firewalls mobile carriers and or phones have on them.

The unity setup requires the master server. I assume this a server that just forwards packets to clients who connect to it directly.

Pages: [1] 2