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

Pages: [1]
1
NGUI 3 Support / Screen Edge Detection
« on: March 06, 2018, 11:01:10 AM »
I'm wondering how everyone else does their screen edge detection.
I'm currently using Camera.pixelWidth/pixelHeight and then comparing a UIWidget's localPosition to these values to detect if the widget is close to the edge of the screen. I imagine I have to adjust the screen edge threshold depending on the current screen resolution, but that's not too big of a deal. I'm not sure if this is the proper way to do it, or if it's error prone in some way.


2
NGUI 3 Support / UICamera.onKey
« on: March 22, 2016, 10:04:21 AM »
Is there a way to capture key down and up events like the onKey handler for UICamera?
I'm aware of OnKeyDown/OnKeyUp, but this requires you polling particular keys. I'd rather have an event handler that reports what key is pressed down or released up.

3
NGUI 3 Support / UIColorPicker
« on: September 17, 2015, 10:51:08 PM »
I'm having problems setting the initial location of the selector. But to note, this happens under a certain condition. What I'm doing is
  1. UIButton existingButton1, existingButton2;
  2. ...
  3. UIColorPicker picker;
  4. picker.value = existingButton1.defaultColor;  // this works
  5.  
  6. // but later on..
  7.  
  8. picker.value = existingButton2.defaultColor;  // this doesn't work. It has the same color as existingButton1
  9.  

Is there something I'm missing to force the update of the UIColorPicker to be the color of the second?

EDIT:

Actually, I figured this out.

  1. picker.Select(existingButton2.defaultColor);

4
Hey, thanks!

That's exactly what I was missing! I really should review what ArenMook says about depth and sort order, etc. I get confused on occasion.

5
NGUI 3 Support / Dropdown of UIPopupList appears behind UIScrollView
« on: June 03, 2015, 02:34:46 PM »
My button that shows a UIPopupList when clicked renders the list behind a UIScrollView that contains a grid of UISprites.
What can I do to get the popup list to appear above the scrollview?

6
NGUI 3 Support / OnResize event handlers?
« on: May 22, 2015, 11:35:53 PM »
Not quite sure if there is such an event that I can listen to, but here is my issue.

I have a parent programmatically creating it's children, and resizing them on creation.
However, during the creation process, the parent size has not yet been fully calculated, and the anchors take effect, thereby resizing the parent. Now, the children do not match the parent width anymore.

I'd like to avoid putting in resize updates in the Update() function if I can, but if there are better solutions, I'd like to hear them.

Thanks!

7
NGUI 3 Support / Re: Manual Sprite positioning
« on: May 22, 2015, 09:38:05 PM »
Thanks for the reply. I wasn't sure if I needed to go between WorldToScreenPoint and ScreenToWorldPoint, but in this case, I don't need to.

The problem that I was actually having was more of a WTF moment late at night. I just had a chance to revisit the problem right now, and realized that I was positioning the cells in the row as if the pivot was on the left of the cell, rather than the center. I added an additional 0.5 * width for each cell, and they were positioned properly.

I definitely have a row as a widget container, and the cells inside of it.

8
NGUI 3 Support / Manual Sprite positioning
« on: May 20, 2015, 02:02:40 AM »
I would like to specify the x coordinates of a series of buttons, such that each subsequent button is adjacent to the previous button.

Details:
This is a "LeaderboardRow", which has 3 items in it for each column, as suggested by the UITable documentation.

Basically, I'd like the first column to be 20% of the width, the second column 50% of the width, and the third column 30% of the width. If there's a way to do this other than manual positioning, I'm all ears.

Somewhere, I saw that it was suggested not to use a UITable in a UITable (which sort of makes sense), but this would be great for calling Reposition() on a row of 3 "cells".

I've done numerous searches, and found results suggesting localPosition of the transform, and converting based on the camera's worldToScreenPoint transform, but I'm not getting any reliable results.

9
NGUI 3 Support / Re: UIDragPanelContents
« on: May 13, 2015, 05:06:56 PM »
Any help with this would be appreciated.

Thanks in advance!

10
NGUI 3 Support / UIDragPanelContents
« on: May 10, 2015, 04:21:04 PM »
I'm implementing a scroll view, and I can't seem to find UIDragPanelContents. Has it been renamed or refactored? Is it an option on the UIScrollView or something? I can't scroll the grid when dragging on one of the grid items, but I can with a background via a DragPanel UIDragScrollView and a BoxCollider.

Probably worth noting that the grid items are UIButtons with BoxColliders also.

11
Actually, figured it out.

After setting the pivot on the UISprite, call ResizeCollider(), even though it's set to auto resize in the script properties.

12
I'm having an issue with a Box Collider on a UIButton.

I programmatically assign a pivot to the UISprite (say, lower left corner) and assign a UIAnchor component (say also lower left).

This correctly positions the geometry against the lower left corner, but the box collider seems to only detect collisions when the mouse is on the left half of the button, when I would want it to be over the entire button.

Anything I'm doing wrong here?

13
NGUI 3 Support / Re: Assign EventDelegate and Parameters from script
« on: February 11, 2015, 11:44:40 PM »
Yup, that worked for me too. Thanks for checking this out for me.

Now to figure out my EBKAC.

EDIT:
And my error was, I was doing all that in a script that wasn't an NGUI control.

14
NGUI 3 Support / Re: Assign EventDelegate and Parameters from script
« on: February 11, 2015, 01:29:21 AM »
Sorry to necro this, but this is completely valid to the problems I'm running into.

I'm doing something similar:
My OnClickMe method gets hit, but my int num is 0. I tried other values, like string and GameObject, and they're null.

  1.         UIButton b = buttonXfrm.gameObject.GetComponent(typeof(UIButton)) as UIButton;
  2.  
  3.         EventDelegate del = new EventDelegate(this, "OnClickMe");
  4.         del.parameters[0].value = 123;
  5.         EventDelegate.Set(b.onClick, del);
  6.  
  7.  
  8.         private void OnClickMe(int num)
  9.         {
  10.  
  11.         }



Any ideas?

15
Misc Archive / Re: New Unity GUI and NGUI
« on: May 15, 2014, 06:49:46 PM »
Hello. First post.

I am interested in purchasing NGUI, and would like to know whether it's possible to use both systems (NGUI and UnityGUI) together without any conflict. While I feel that $95 is a reasonable price to ask for NGUI, I can't help feel that I should either wait for a sale, similar to the current Madness Sale that's going on right now) and use UnityGUI in the meantime. As I am just starting out projects in Unity, my only purpose for UI at the moment will be for debug purposes only. However, I would eventually like to transfer some functionality from UnityGUI to NGUI as it comes time to roll out the real thing. I'd like to know thoughts on this development plan. Thanks!

Pages: [1]