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

Pages: [1] 2 3 ... 5
NGUI 3 Support / Culling Mask being changed inside NGUI?
« on: March 23, 2015, 02:45:08 PM »
Hey guys, this is driving me nuts, the hole scenario is, I had a really complex UI, with a lot of elements and about 5 cameras.

One of this is responsible for the Alert Popups, like everything else in this UI I'm using a lot of PoolableObjects, so just to get an Idea of what looks like, is something like that:

In my Alert Camera, I had the Event Mask only marked to the Alert Layer, and in my Camera, the same, this is suppose to only render and interact with the Alert Objects.

And in the initiation of this objects from the pool, I do exactly like NGUITools.AddChild, but I do in my own way, to get the object from the Pool:

  1.  /// <summary>
  2.     /// Display an decision box with 2 choices
  3.     /// </summary>
  4.    /// <param name="title">title of the screen</param>
  5.    /// <param name="content">Target text to be displayed</param>
  6.     /// <param name="button1Label">Label of the button 1</param>
  7.     /// <param name="button2Label">Label of button 2</param>
  8.     /// <param name="button1Callback">Callback for the button 1</param>
  9.     /// <param name="button2Callback">Callback for the button 2</param>
  10.     /// <param name="showOverlay"></param>
  11.     /// <returns></returns>
  12.    public static DecisionAlert ShowDecision(string title, string content, string button1Label, string button2Label, Action button1Callback, Action button2Callback, bool showOverlay = true)
  13.    {
  14.        DecisionAlert alert = ObjectPoolController.Instantiate(Instance.AvaliableAlerts[(int)AlertTypes.Decision].gameObject).GetComponent<DecisionAlert>();
  15.        alert.transform.parent = Instance.ContentTable.transform;
  16.        alert.transform.localScale =;
  17.        alert.transform.localPosition =;
  18.        NGUITools.MarkParentAsChanged(Instance.ContentTable.gameObject);
  20.        alert.Init(title, content, button1Label, button2Label, button1Callback, button2Callback);
  21.        if (showOverlay)
  22.        {
  23.            ShowOverlay();
  24.        }
  26.        Instance.m_activeAlerts.Add(alert);
  28.        return alert;
  29.     }

Now is the strange part, i had a simple button to test this, and keep adding this to the view, and test it out. If i press this button a bunch of times, everything goes perfect, but when I close this Alerts (Pressing the Close button) and try to add a new one, this new one comes from the Pool, and then something strange happen.
My camera lost his Culling Mask, a new UIRoot is created with a new Panel, and from now on, If i remove the new UIRoot, and add one more, the UIRoot is created again.

I do this in mostly every part of the project, but only this one is giving me this problem.

Someone know what can be?

I'm using the 3.8.1 version and Unity: 4.6.3f1

I know this is not a common thing to ask, but I want to be able to let the user search for a string, and keep able to select when he found something, without closing the keyboard, anyone know a solution for something like this?

NGUI 3 Support / Strange issues Unity 4.6.0p1 and NGUI v3.7.6p2
« on: December 05, 2014, 08:47:21 AM »
Hey guys, I'm experiencing this issue right now:

full version here:

Basically I've a few this that are instantiate inside a Scrollview, and looks like are not been update at the right time?! I really can't understand really well what is going on, cause on the Editor View, the bounding box of the object are in the right place, but is not being draw in the right place, when I move this, (dragging) backs to the desired place.

Anyone know what is happening?

One thing that can help you with this case, is export your image with 2 transparent pixels border from each side, in this way you can rotate the image with better aliasing.

Misc Archive / Re: Windward is now out on Steam
« on: October 24, 2014, 04:07:59 PM »
Amazing progress! Just bought :D

Misc Archive / Re: Building Material Design UI with NGUI
« on: October 22, 2014, 01:20:58 PM »
Amazing WORK!

Any chance of you share this "clipping-compatible depth cutout shader"

NGUI 3 Support / Re: Displaying Int value with Sprites?
« on: October 16, 2014, 03:27:14 PM »
Hello People! I was just wondering is there any way to convert my "Health value" that is stored in a Int could be displayed in runtime as Sprites?
The Sprites are in a NGui atlas so.. thought?
I'm not sure of what you're asking, but the answer is YES YOU CAN!

Just keep a reference of this sprite, and change the sprite as your health value.

  1. if(health < 10)
  2. {
  3.      targetSprite.spriteName = "LowHealth";
  4. }

NGUI 3 Support / Re: Collecting Data Generated Through the UI
« on: October 16, 2014, 03:25:12 PM »
Why not just put a reference to this UIInput on your class  and get the data whenever you want using UIInputField.value? Then just add to the list list.Add(targetInput.value);

if you want a 3D like turning page, you should user Unity itself!
But if you want to feel like 3D, you can make it using a bunch of masks / panels things, but I don't think worth it.

There is a ton of things like that:

He probably having the same issue that I've on this topic:;topicseen

Try remove the UseMouse on the camera?

NGUI 3 Support / Re: Make Some Improvements please!
« on: October 16, 2014, 06:24:54 AM »
Hi dude, keep calm the support of NGUI is way better than much others softwares out there! And your question was replied a lot of times, was pretty easy found the answer, but here is what you want:

  1. //Get the position of the object that you want.
  2. Vector3 pos = mGameCamera.WorldToViewportPoint(target.position);
  4. //Move the target GUI Element to the desired position
  5. transform.position = mUICamera.ViewportToWorldPoint(pos);
  6. pos = transform.localPosition;
  7. pos.x = Mathf.RoundToInt(pos.x);
  8. pos.y = Mathf.RoundToInt(pos.y);
  9. pos.z = 0f;
  10. transform.localPosition = pos;

Hey just a heads up, I've a lot of buttons inside and ScrollView and everything works fine on editor, but running on the Android, they stay on the Over state when I drag outside the button collider.

To fix that is just add the Android platform in to this statement too, from:

Line: 1128 from UICamera.
  1. if (Application.platform == RuntimePlatform.IPhonePlayer)
  2. {
  3.       useMouse = false;
  4.       useKeyboard = false;
  5.       useController = false;
  6. }

  1. if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android)
  2. {
  3.       useMouse = false;
  4.       useKeyboard = false;
  5.       useController = false;
  6. }

NGUI 3 Support / Re: clipping a panel with a non-square rect
« on: September 18, 2014, 04:54:50 PM »
Awesome news! Thank you guys :D

NGUI 3 Support / Re: clipping a panel with a non-square rect
« on: September 17, 2014, 07:50:05 PM »

This mask feature of the new Unity almost made me switch a entire project to it!
But I'll give a try in this test, and try to update this to the new NGUI! :D

Thanks for sharing this!

Pages: [1] 2 3 ... 5