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

Pages: [1] 2
1
Hi, I have updated NGUI from 3.6.0 to 3.9.4 in a project I am working and today I ended up with a NullReferenceException in Android platform, where the UI2DSprite was not being rendered in the device, but in Unity Editor the NullReferenceException does not happen.

So, I have reverted the modifications inner "UIDrawCall.Create(string name)" method and the problem was fixed.

Fix in UIDrawCall.cs (v3.9.4), line 714:
  1.                 if (mInactiveList.size > 0)
  2.                 {
  3.                         UIDrawCall dc = mInactiveList.Pop();
  4.                         if (dc!=null && dc.gameObject != null) // -> this line is present in version 3.6.0
  5.                         {
  6.                                 mActiveList.Add(dc);
  7.  
  8.                                 if (name != null) dc.name = name;
  9.                                 NGUITools.SetActive(dc.gameObject, true);
  10.                                 return dc;
  11.                         }
  12.                 }
  13.  

This is what I got from adb logcat:
  1. I/Unity   ( 5425): NullReferenceException
  2. I/Unity   ( 5425):   at UIDrawCall.Create (System.String name) [0x00033] in C:\Users\...\Assets\Third Parties\NGUI\Scripts\Internal\UIDrawCall.cs:778
  3. I/Unity   ( 5425):   at UIDrawCall.Create (System.String name, .UIPanel pan, UnityEngine.Material mat, UnityEngine.Texture tex, UnityEngine.Shader shader) [0x00000] in C:\Users\...\Assets\Third Parties\NGUI\Scripts\Internal\UIDrawCall.cs:753
  4. I/Unity   ( 5425):   at UIDrawCall.Create (.UIPanel panel, UnityEngine.Material mat, UnityEngine.Texture tex, UnityEngine.Shader shader) [0x00000] in C:\Users\...\Assets\Third Parties\NGUI\Scripts\Internal\UIDrawCall.cs:743
  5. I/Unity   ( 5425):   at UIPanel.FillAllDrawCalls () [0x0014e] in C:\Users\...\Assets\NGUI\Scripts\UI\UIPanel.cs:1248

2
NGUI 3 Support / Re: I2 Localization for NGUI
« on: September 26, 2014, 03:57:39 PM »
I'd like to say I am so glad to using I2 Localization. It become my life easier :)

3
NGUI 3 Support / Re: Change UILabel Material in Real-time
« on: September 09, 2014, 01:39:32 PM »
Thank you, ArenMook. It is now fixed.

About the OnGUI, I just used it to show you how the problem was happening :)

4
NGUI 3 Support / Re: Need help with an Bag for an MMORPG Game
« on: September 08, 2014, 01:22:38 PM »
You can to use the Anchors to keep your Elements positioned according another ones.

Get a look in this tutorial:
https://www.youtube.com/watch?v=GIpccFRIXmo

5
NGUI 3 Support / Re: Change UILabel Material in Real-time
« on: September 07, 2014, 06:49:00 PM »

6
NGUI 3 Support / Re: Change UILabel Material in Real-time
« on: September 06, 2014, 09:28:37 PM »
yes, I'm using dynamic font in the UILabel.

In the Attachment Files I've uploaded a file with the video showing the error.

Thank you for the attention, ArenMook.

7
NGUI 3 Support / Change UILabel Material in Real-time
« on: September 06, 2014, 12:22:22 AM »
Hello ArenMook,

I'm trying to change the Material of my UILabel in real-time. The Material is changed but the effect does not happen.

The effect happens when I set the Material Manually via Inspector, so I can't understand my mistake :(

I'm setting it like this:
  1. this.GetComponent<UILabel>().material = newMaterial;
  2.  

8
NGUI 3 Support / Re: I2 Localization for NGUI
« on: March 13, 2014, 01:59:33 PM »
Just wanted to let you know that the I2 Localization is temporally on Sale!
Hi Frank, the Sale in AssetStore already has been ended?

9
NGUI 3 Support / [UILabel] Snap and Make Pixel Perfect.
« on: February 07, 2014, 12:12:32 PM »
Hi ArenMook,

I've noticed that in the 3.4.8 version, the Snap and Make Pixel Perfect are Resizing the Widget.Dimensions to match with Font Size. This is happening even when Overflow is ShrinkContent, but this was not happening in 3.3.3 (previously 3.0.8 f4) version.

Is this intentional?

And also, the Sprite using "Sprite Type: Simple", happens the same thing. This already happens with Sprite since I started to use NGUI.

I don't know about other developers, but I think it would be a good thing not resize Dimensions of Sprite/UILabel when using Snap or Make Pixel Perfect.  :P

10
NGUI 3 Support / Re: A suggestion
« on: February 07, 2014, 11:32:28 AM »
I think this is a hard thing to happens, because the major part of developers that are using NGUI, are using it in your Serious Projects. So I think that no one will want "or will can" to share your Professional Project, hehe.

11
NGUI 3 Support / Re: CaratChar variable no longer exposed?
« on: December 24, 2013, 11:32:26 PM »
3.0.8 has a blinking carat built-in (http://www.tasharen.com/ngui/example12.html), so just wait for the update to be released (eta evening of the 27th), or if you have Pro -- grab the latest and use it now.
Wowww, I was waiting for this feature a long time ago :)
Thanks ArenMook and Merry Christmas.

12
NGUI 3 Support / Re: UILabel Shrink
« on: May 23, 2013, 07:18:07 PM »

I've tested this and didn't work to me. It convert everything into 1 smaller line. =/
Use the ArenMook's solution. That is a perfect solution, and you dont need modify the NGUI Scripts.

when you want to use auto-shrink, but cap it at a specific size, add a parent object to the label and scale the parent object instead. For example if you had size 48 font and wanted a size 32 label do this:

GameObject (scale of 32 / 48)
- Label (shrink to fit)

No code modifications needed.

13
NGUI 3 Support / Re: UILabel Shrink
« on: April 23, 2013, 04:14:50 PM »
As I advised in some random email (this is why I REALLY hate answering private emails/PMs! -- they don't help anyone else!)
I also agree.

when you want to use auto-shrink, but cap it at a specific size, add a parent object to the label and scale the parent object instead. For example if you had size 48 font and wanted a size 32 label do this:

GameObject (scale of 32 / 48)
- Label (shrink to fit)

No code modifications needed.
Perfect solution :)

14
NGUI 3 Support / Re: UILabel Shrink
« on: April 11, 2013, 10:13:31 PM »
Nice, but ideally it should just overwrite how the "max lines" property is treated, not introduce a new variable.
I did this because i need use a Label with smaller size that Original Font Size.
i.e., my font is Arial 35, and i need create a Label with your size 25. But if i use the "Shrink to Fit", and the Text is changed, then the Shrink System can re-size my Label to 35, but i want the Label with the max size 25 :(

Remembering that here these modifications are working successful. But when you release a new version of NGUI, i will lose my modifications :(

Sorry for my english.

15
NGUI 3 Support / Re: UILabel Shrink
« on: April 11, 2013, 02:45:59 AM »
@ArenMook
I am using the Shrink to Fit in a Object that i need your size be not Pixel-perfect. Then i modified the UILabel and UILabelInspector classes to add a new field in Inspector to me set the Maximum font size when Shrink To Fit is being used.
Maybe this can help other peoples, or if you want put this in the Official Package, it would amazing :)

Modifications in the UILabel class:
Add in line 33:
  1.         [HideInInspector][SerializeField] int mShrinkMaxFontSize = 10; // Default value, but the user need set manually
  2.  

Add in Line 577:
  1.         /// <summary>
  2.         /// Maximum font size when Shrink To Fit is being used.
  3.         /// </summary>
  4.  
  5.         public int shrinkMaxFontSize
  6.         {
  7.                 get
  8.                 {
  9.                         return mShrinkMaxFontSize;
  10.                 }
  11.                 set
  12.                 {
  13.                         if (mShrinkMaxFontSize != value)
  14.                         {
  15.                                 mShrinkMaxFontSize = value;
  16.                                 hasChanged = true;
  17.                         }
  18.                 }
  19.         }
  20.  
  21.  

Modify Lines 526-537:
  1.                         // We want to shrink the label (when it doesn't fit)
  2.                         if (scale > 0f)
  3.                         {
  4.                                 float maxSize = (float)mMaxLineWidth / shrinkMaxFontSize;
  5.                                 scale = (mSize.x > maxSize) ? (maxSize / mSize.x) * shrinkMaxFontSize : shrinkMaxFontSize;
  6.                                 cachedTransform.localScale = new Vector3(scale, scale, 1f);
  7.                         }
  8.                         else
  9.                         {
  10.                                 mSize.x = 1f;
  11.                                 cachedTransform.localScale = new Vector3(shrinkMaxFontSize, shrinkMaxFontSize, 1f);
  12.                         }
  13.  

Modifications in the UILabelInspector class:
Add in Line 66:
  1.                 if (shrinkToFit)
  2.                 {
  3.                         GUILayout.BeginHorizontal();
  4.                         int scale = EditorGUILayout.IntField("Max Font Scale", mLabel.shrinkMaxFontSize, GUILayout.Width(120f));
  5.                         GUILayout.Label("pixels");
  6.                         GUILayout.EndHorizontal();
  7.                         if (len != mLabel.shrinkMaxFontSize) { RegisterUndo(); mLabel.shrinkMaxFontSize = scale; }
  8.                 }
  9.  

Pages: [1] 2