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

Pages: [1]
1
NGUI 3 Support / Text spacing, y u no float?
« on: October 09, 2014, 08:36:14 AM »
Hey!

So I want to animate the text spacing of a label, to make it fold out, like an accordion.
This works, but it moves in visible steps, because text spacing is not set as floats but ints.

I managed to get around this by changing UILabel, so it exposes text spacing as a float.
It does use float when setting the text spacing internally anyway.

However, I really don't like having to change the NGUI source code, since I'll have to do it for every update.
I realize that you can't just change the spacing to float in the next NGUI, since it won't use the old serialized spacing that was saved as an int. Right?

Is there by any chance, a way that NGUI could add this functionality, without breaking anything?

Thanks!

2
NGUI 3 Support / Kerning problem with bitmap font
« on: August 08, 2014, 08:26:51 AM »
I have a problem with the font kerning between the characters 6 and 1, in that order.
It only happens with the bitmap font I generated using the Font Maker.
A dynamic font, seems to work fine.


Bitmap font above, dynamic font below

I looked at the bitmap font prefab, and found where it save the kerning. It looks like this:

"kerning: 43000000ffffffff44000000f5ffffff4e000000fcffffff50000000f9ffffff51000000f9ffffff53000000ffffffff58000000f8ffffff"

Unfortunately, I have no idea of how to decipher that.
Any suggestions?

3
NGUI 3 Support / Bitmap font, numeric bug
« on: July 07, 2014, 07:57:33 AM »
Hello

Just discovered a small bug.
Setting a bitmap font to generate numeric chars will add 0 to the font twice.

I'm on NGUI 3.6.4b, so for all I know this might have been fixed in a newer version.
Just thought I'd report it anyway.


4
NGUI 3 Support / Anchors not updating when size change
« on: June 19, 2014, 08:26:14 AM »
I just updated from NGUI 3.6.0 to 3.6.4b.

Now I have several places where anchors need a frame before they refresh.
In the .gif below, the funny spiral-like icon is anchored to the label that says "1280" and set to OnUpdate.

That label is updated in the first frame, so it changes it size.
I'm guessing the anchor gets updated before the size is changed, and that's why it doesn't anchor to the right position until the next frame.

It works if I manually call UpdateAnchors, but that seems a bit like a hotfix.



Did anything change from 3.6.0 to 3.6.4 that could cause this?

5
NGUI 3 Support / Nested alpha, feature or bug?
« on: April 30, 2014, 08:03:02 AM »
Hi there!

I recently encountered some funky behaviour when nesting widgets.



So in the above image.
"b" is a child of "a".
"b" should be 100% opaque since the alpha component of it's color is 255.
But as a result of being a child of "a", it inherits the alpha.
The same is true for the label "d", which is also a child of "a".

This behaviour was a bit unexpected, but maybe it's intentional?

Thanks! :-)

6
NGUI 3 Support / NGUI warnings
« on: March 12, 2014, 06:11:46 AM »
Hello

I'm currently in the process of cleaning up the warnings in our Unity project.
I'm getting three warnings from NGUI, I'm on version 3.5.1.

Field 'UIToggle.radioButtonRoot' is never assigned to, and will always have its default value null   UIToggle.cs 76
Field 'UISlider.foreground' is never assigned to, and will always have its default value null   UISlider.cs   25
Field 'SpringPosition.eventReceiver' is never assigned to, and will always have its default value null SpringPosition.cs 57

7
NGUI 3 Support / Single frame delay on drawing
« on: March 04, 2014, 11:02:05 AM »
Hello!

So I have a panel which gets set active, using NGUITools.SetActive.
Afterwards I do some activating, deactivating and moving some child widgets.
The widget gizmos get updated right away, and are located in the right position, but it doesn't draw the moved widgets until one frame later.

I tried calling refresh on the panel, broadcasting CreatePanel, broadcasting UpdateWidgets, Broadcasting FillAllDrawCalls..
But nothing seems to work.

What to do? :-)

8
NGUI 3 Support / Scroll view widgets render problem + hotfix
« on: February 11, 2014, 04:08:38 AM »
Hello!

I have a scroll view, nested under another gameobject.
This gameobject is a popup which is set active and then moved every once in a while, and since the scroll view is a child it will move with the popup.

The problem is that whenever I set the parent active in a new position, the widgets in the scroll view will be offset from their actual bounds.
Here's a screenshot displaying the problem:



The widgets will jump back to being rendered in the right place as soon as I interact with the scroll view.
I fixed the problem with these two statements directly after moving the parent.

  1. _scrollView.MoveRelative(Vector3.up);
  2. _scrollView.MoveRelative(Vector3.down);
  3.  

9
NGUI 3 Support / Unnecessary warning - UIButtonColor
« on: February 10, 2014, 05:24:51 AM »
Hey there!

I'm adding a UIButtonColor component during runtime, and then afterwards setting the tweenTarget to a child gameobject.

So like this:
  1. var buttonColor = gameObject.AddComponent<UIButtonColor>();
  2. buttonColor.tweenTarget = highlightGo;

Now Init will be called on the UIButtonColor component before the tween target is set, since Init is called in Awake.
If the gameobject with the UIButtonColor component on it doesn't have a widget, renderer or light on it, the warning on Line 139 (In UIButtonColor.cs) will be logged.

I'm using this several places, so I get a lot of annoying warnings.

It's not a huge deal, but I feel like I should be able to set the tween target before it yells at me :-)

10
NGUI 3 Support / Execute all?
« on: December 10, 2013, 04:27:48 AM »
This is not really a support question, sorry!

I was looking for the old "Run Now", or whatever is was called on my UITable.
I couldn't find it, so I looked through the code and found that you are now using a ContextMenu with the title "Execute" on all of the things that can be updated.

I thought it would be nice if maybe you could update everything, at once! So here's my little contribution to that:

  1. [MenuItem("NGUI/Quick Actions/Execute All")]
  2. private static void ExecuteAll()
  3. {
  4.     foreach (var obj in Object.FindObjectsOfType<MonoBehaviour>())
  5.     {
  6.         var methods = obj.GetType().GetMethods(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
  7.         var executeMethod = methods.FirstOrDefault(m => m.GetCustomAttributes(typeof(ContextMenu), false).Any(cm => (cm as ContextMenu).menuItem == "Execute"));
  8.  
  9.         if (executeMethod != null)
  10.         {
  11.             executeMethod.Invoke(obj, null);
  12.         }
  13.     }
  14. }
  15.  

11
NGUI 3 Support / NGUI 3.0.6 - inertia tensor failed
« on: November 26, 2013, 09:22:06 AM »
Hi there  :)

Since I updated to NGUI 3.0.6 I kept getting an error that has to do with rigidbodies:

Actor::updateMassFromShapes: Compute mesh inertia tensor failed for one of the actor's mesh shapes! Please change mesh geometry or supply a tensor manually!
UnityEngine.Transform:set_parent(Transform)
NGUITools:AddChild(GameObject, GameObject) (at Assets/NGUI/Scripts/Internal/NGUITools.cs:407)

The error didn't seem to cause any trouble, but I found it very weird since I'm not using any rigidbodies.
The changelog mentions that NGUI now adds rigidbodies to the panels, perhaps this is the source of the error?

"- FIX: Panels will now add rigidbodies to themselves since Unity 4.3 mentions it should improve performance."

Thanks in advance!

12
NGUI 3 Support / I don't understand widget bounds
« on: December 14, 2012, 05:48:55 PM »
Hello there

I have a draggable camera in my scene, which I would like to give bigger bounds.
I can understand that the bounds are calculated by child widgets to the 'root for bounds' transform, correct?

I would think that I should just place two widgets a long way from each other and I would get big bounds.
However this is not the case, the camera can only be dragged a fixed amount. It's the same amount with or without the widgets.

Optimally i would just have the camera dragged freely, without any constraints in the position.

Hope you understand the problem.
Thanks in advance :-)

13
NGUI 3 Support / Going from free to paid
« on: December 08, 2012, 12:20:43 PM »
Hello there

I have been using the free version of NGUI for a couple of days now.

Before I buy a license, which I probably will (Because NGUI is so awesome!). I would like to know how easy it is to switch from the free version, to the paid version.
Can I implement our GUI, and just import the paid NGUI package on top of the free one and expect it to work?

Or should i implement my GUI from the start with the paid version?

Thanks in advance :-)

Pages: [1]