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

Pages: [1]
1
NGUI 3 Support / Re: UIDragDropItem constrain behaviour?
« on: October 06, 2014, 03:41:00 PM »
Thank you.

Artrageous

2
NGUI 3 Support / UIDragDropItem constrain behaviour?
« on: October 05, 2014, 10:08:44 PM »
I have a question about objects using a UIDragDropItem script, and constraining them to a background object.

I am making a colour picker. I need to drag a cursor around on a coloured background.
This is easy to do, as per examples - cursor is a sprite with UIDragDropItem script, background is a sprite with UIDragDropContainer script.
However, I want to constrain the cursor so it cannot be dragged off the background sprite , but remains visible at the edge of background sprite when the drag leaves it.

What is the best way to do this?
I can put the background sprite on a UIPanel, and turn on clipping - this means you can't see the cursor when it is dragged off the background, but I want it to remain visible at the edge.
What does "Constrain but dont clip"? on the UIPanel script do?

I suppose could intercept the cursor's UIDragDropItem callbacks, and update the position so it remains on edge of the background?

Whats the recommended way to do this?

Thanks
Artrageous

3
Thank you.
I knew it had to be something simple.

Artrageous

4
What is the best way to pass an OnClick event on to objects behind the top object?
I have a button, with a Box collider, that gets OnClick() events. I have my own OnClick routine  to handle these. This works fine.
I want the parent object the button is on to also get the OnClick event when I click the button.
This parent object is a sprite, it is the parent of the button in the object hierarchy, and behind it in the scene.
What is the best way to do this?
I could get a  reference to the parent object, store it in the button, and call the it's routines in the button OnClick , but this seems a bit unwieldy.

Thanks

Artrageous

PS
Have the feeling that this is a stupid question, and I am missing something obvious!

5
Thank you.
I feel slightly foolish now.

I wonder why Unity does this?

Artrageous

6
Hi,
I have encountered a problem; Prefabs containing UIGrid don't display correctly in the Project View.
In the Project View, Prefab's UIGrid's contents aren't show.
If you drag the prefab into the scene, or programmatically instantiate it, the  UIGrid's contents are present, and appear correct.

See attached image.

Is this a bug? If so, can anything be done about it?

Thanks
Artrageous

Pages: [1]