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

Pages: [1]
1
NGUI 3 Support / Re: Problems with the paid version NGUI
« on: July 26, 2013, 10:15:07 AM »
Hi, have you tried re-importing the new version including everything in the package? Failing that, remove all traces of the old version, then re-import the new version.

I guess after that, there could be code differences between the free and paid versions that might mean you need a few tweaks to your code?

2
NGUI 3 Support / Re: UIInput OnSubmit loses focus
« on: July 26, 2013, 10:11:53 AM »
Yep, thanks for that, fixed it perfectly. If you wait in a coroutine for the end of the frame, then set the object as selected, the carat appears, and the object accepts keyboard input.

3
NGUI 3 Support / Re: Widget Bounds and OnHover
« on: July 26, 2013, 08:40:20 AM »
I found a much easier method, than redirecting all events. Here's a simple method to get the bounds of an object in the same scale as the mouse position given by UICamera.lastTouchPosition

  1. public Vector4 GetBounds()
  2. {
  3.     Bounds bounds = NGUIMath.CalculateRelativeWidgetBounds(UICamera.currentCamera.transform, transform);
  4.     float x = bounds.center.x - (bounds.size.x / 2) + (Screen.width / 2);
  5.     float y = bounds.center.y - (bounds.size.y / 2) + (Screen.height / 2);
  6.     float w = bounds.size.x;
  7.     float h = bounds.size.y;   
  8.     return new Vector4(x, y, w, h);
  9. }


Though I've now discovered a new issue with the OnHover event. If the mouse is moved fast, OnHover(false) is never raised. Still working out how to solve this one.

4
NGUI 3 Support / [Solved] UIInput OnSubmit loses focus
« on: July 25, 2013, 09:30:12 AM »
I've got a UIInput widget which works as intended, but seems to lose the focus after Return is pressed and the OnSubmit event is fired.

I get the OnSubmit event, and deal with the text, before setting the text to empty myUIInput.text = "";
At this point, the UIInput seems to lose focus, and only clicking inside it again makes it selected.

I've tried myUIInput.selected = true; but that doesn't seem to do anything. I've tried setting .selected to false then to true, but that doesn't help either.

How do I refocus the UIInput using code C# so that it's automatically ready to receive more input from the keyboard (as if I'd clicked inside it)?

5
NGUI 3 Support / Widget Bounds and OnHover
« on: July 25, 2013, 08:01:52 AM »
Hi,

I've got a context menu that is full of options (labels with colliders). I'd like the context menu to disappear when the mouse moves out of it for which I'm using OnHover(false).

My problem is, when the mouse moves over one of the options, the OnHover(false) event is fired on the context menu holder. My idea is to also check if the mouse is within the bounds of the context menu holder object before closing it.

I'm having trouble finding the mouse position and context menu holder bounds, to tie it all together.

6
NGUI 3 Support / Re: Events not firing...
« on: July 02, 2013, 04:54:44 AM »
Thanks guys, that gave me the info I needed XD I had one object in the UI_Root tree that was set to the wrong layer. Changed that, and it all works perfectly (well, gives me a load of errors, but those I can run through np).

7
NGUI 3 Support / Events not firing...
« on: July 01, 2013, 12:17:51 PM »
Hi, I've just purchased NGUI, and am working out how it operates (so pretty nooby).

I have a GameObject with a UITextList attached to it. I've also attached a BoxCollider, so that mouse click events will be triggered. I've edited the UITextList.cs file so that OnSelect and OnScroll events give a debug.log just to show that they've triggered.

However, no events seem to trigger, the object is never selected. I've no real idea where to start looking to find a solution; does anyone have any idea what may be wrong?

Pages: [1]