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

Pages: [1]
1
NGUI 3 Support / 364 -> 368 upgrade messes up anchors
« on: August 01, 2014, 06:24:23 AM »
I have upgraded NGUI until now without any big issues

However, after making the update from 3.6.4 to the latest 275c7bb51c8d9d50f3d620c1f028c558aee61bcf commit (version 3.6.8) the anchors and widgets went crazy

I have 2 UIRoots in 2 different scenes -> preloader + game

Preloader loads the game scene

Now, it appears that all the anchors from the game scene went crazy..

Content is my panel that is the first child of the UICamera which is the child of UIRoot

This is how an anchor looks in editor: https://www.dropbox.com/s/do1wvwt8lcy78an/Screenshot%202014-08-01%2014.18.38.png

In the editor, after the scene is loaded: https://www.dropbox.com/s/vpz918sdv848rgk/Screenshot%202014-08-01%2014.21.50.png
In the editor, after the scene is loaded(zoomed out a lot): https://www.dropbox.com/s/68sqnrr9kzfewp6/Screenshot%202014-08-01%2014.21.31.png

If I remove the anchor reference and add it again, the anchors appear to have recovered(pointing to the middle of the screen): https://www.dropbox.com/s/623pl8rxl2rw5wc/Screenshot%202014-08-01%2014.22.54.png

Can you please let me know at how I should try and deal with the problem?

Thanks

2
NGUI 3 Support / translucent / blurred sprite like ios7
« on: February 21, 2014, 07:44:59 AM »
Is there any way to achieve this with NGUI?

Would anyone be able to share a shader that does something similar to this?

Cheers

3
NGUI 3 Support / Offset widget
« on: February 21, 2014, 07:43:53 AM »
Until now, if I had a width W widget, i used to offset from rights target for left and right:
for left: OFFSET
for right: OFFSET + W

I think this is not an elegant way of dealing with offseting widgets and I would be grateful for a better solution. I simply want the right edge of my widget to be at an OFFSET distance of a target, even if the widget width changes. Is there a simple way to do this without calculating the left and right offsets based on the widget width?

Since upgrading to 3.5.0b I am not sure the way I use still works

If I change the width of the widget used as Unified Anchor(let's call it reference), to widgets that are anchored to it will no longer change their position. They simply stay in the same place and the Left and Right constraints change accordingly. However, if I change the widget dimensions from editor, it works :)

I think the change that broke the functionality is this: https://github.com/tasharen/ngui/commit/1618d32c3e63d00146746df77f8f8d0bead40b09#diff-89a3fb27e36824b406e234bfeb9dcda3

4
NGUI 3 Support / Atlas maker problem
« on: January 18, 2014, 02:07:00 PM »
I have a set of large image files(15) - around 750x1000

If I make an atlas with all of them, Unity is hanging but gets it done (it's normal)

Now, the problem appears when I try to make changes to an existing atlas..

If I make an atlas, with let's say 9 files.. and I want to add 6 more in one shot, unity is dead.. the loading bar of the Atlas Maker will go up to 100% but it will hang forever..

Now, if I add the images one by one, it works ok.. if I add 2 at a time, it works sometimes and if I add more, unity is dead again..

Is this normal?

5
NGUI 3 Support / EventDelegate.Execute - order of operations
« on: January 10, 2014, 12:49:27 PM »
When you trigger a delegate in EventDelegate.Execute, the order is this:

for (int i = 0; i < list.Count; )
         {
            EventDelegate del = list;

            if (del != null)
            {
               // DELEGATE GETS EXECUTED
               del.Execute();

               if (del.oneShot)
               {
                  // DELEGATE GETS REMOVED
                  list.RemoveAt(i);
                  continue;
               }
            }
            ++i;
         }

I have an use case that, when executing an onFinished delegate, I want to add another onFinished delegate on the same object..

The problem is that the code execution will trigger Execute() and I will try to re-add a similar delegate in the same execution stack..

This will cause the EventDelegate to check if it already has the delegate, it will see that it has it.. then the execution gets back to the above line, list.RemoveAt(i) and the delegate will get removed

Proposed solution 1:

Call the del.Execute() method after the list.RemoveAt(i)

Proposed solution 2 - more complex, but safer:

Save a list of the delegates that need to be triggered, let the execution flow remove all the delegates from the list.. And after the for loop is finished, call all the delegates in another for loop

6
NGUI 3 Support / (MonoBehaviour) callback.Target InvalidCastException
« on: January 10, 2014, 12:41:11 PM »
I have an error when using Tweens with listeners that belong to custom classes, not MonoBehaviours

InvalidCastException: Cannot cast from source type to destination type. EventDelegate.Equals (System.Object obj) "EventDelegate.cs:118"

I have a class: Custom
I have a tween on a MonoBehaviour
I access the tween from the Custom class
I add a delegate for the tween that is a method in my Custom class
EventDelegate.cs:118 tries to check for the existance of that delegate (happens only with REFLECTION_SUPPORT on)

The fail is because of (MonoBehaviour)callback.Target -> This causes an InvalidCastException

The fix:

Please check for callback.Target is MonoBehaviour && mTarget == callback.Target as MonoBehaviour

OR simpler

mTarget == callback.Target as MonoBehaviour

The as cast will evaluate to null but won't throw an exception



7
NGUI 3 Support / Multiple aspect ratios with the new anchor
« on: December 17, 2013, 08:36:47 AM »
How can I set a UITexture to stretch relative to height or width, but keep the aspect ratio?

8
NGUI 3 Support / Box collider not resizing
« on: December 12, 2013, 04:51:42 PM »
I have an empty game object that has a UIWidget component and a Box Collider..

If I select auto-resize the box collider won't resize because of line 224 from UIWidget:

public bool isVisible { get { return mIsVisible && mGeom != null && mGeom.hasVertices; } }

If I change to

public bool isVisible { get { return mIsVisible; } }

It will work ok

9
NGUI 3 Support / Tweens vs Animation
« on: December 02, 2013, 12:26:30 PM »
I have a grid with 10 buttons that need to pop in with elastic ease and a delay between them

What would be the best approach using ngui?
Use animations
Use pre-defined tweens
Create some kind of a custom tween that will get applied to all the buttons

Pages: [1]