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

5
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!

6
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.

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

8
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?

Pages: [1]