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 - appminis-mike

Pages: [1] 2 3
1
I'm trying to create a UIButton at runtime:

  1. NGUITools.AddChild<UIButton>(parentObject);
  2.  

This throws an exception, as the TweenTarget is not set. I don't see a way to set it, though, as the AddChild call itself throws the exception.

Is there a way to create a new UIButton in a script without causing an exception?

Thank you.

2
NGUI 3 Support / Re: UITable not spacing resized items properly
« on: March 06, 2014, 12:10:43 PM »
Element is not anchored, and it is being sized properly (I can see the borders in the scene view). Its children are, though, and I tried calling gameObject.BroadcastMessage("UpdateAnchors"), but that didn't help. Everything looks to be sizing properly, it's just the positions within the UITable that are off.

3
NGUI 3 Support / Re: UITable not spacing resized items properly
« on: March 06, 2014, 11:31:25 AM »
They're prefabs with UIWidget scripts on them, and child elements with other UIWidgets, UILabels, and UISprites. I'm setting the height of the top level UIWidgets.

It looks like this:

Element (UIWidget)
  Background (UIWidget)
    Sprite (UISprite)
  Title (UILabel)
  Description (UILabel)

where Element.height is what I'm setting, and I'm adding an arbitrary number of those to the UITable.

4
NGUI 3 Support / UITable not spacing resized items properly
« on: March 05, 2014, 08:45:26 PM »
I'm adding some elements to a UITable (using NGUITools.AddChild), and I set their heights according to their needs of their contents. After all of this, I call the UITable's Reposition() function. However, the elements are not spaced properly. There are large gaps between them, as though the table still thinks they are their original size. I have the table's padding set to 6, so I would expect only 6 pixels of gap between them, but there is much, much more.

What might cause this behavior?

Thank you.

5
NGUI 3 Support / Re: Scrollbar slider/foreground has very limited range
« on: February 19, 2014, 12:52:03 PM »
That was indeed the case, and it's working properly now. Thank you.

6
NGUI 3 Support / Scrollbar slider/foreground has very limited range
« on: February 18, 2014, 02:05:21 PM »
My scrollbar slider (or foreground) doesn't have the full range of motion of the background. It only moves a tiny bit, relative to the motion of the scroll view it's attached to. It interpolates over that range, but I'd like to move along the full background bar.

See here:



The image on the left is the scroll bar scrolled all the way to the top, and the one on the right is it scrolled all the way down. What I want is for when it is scrolled all the way down is for the slider to be at the bottom of the bar.

How can I get its range of motion to match the background's height?

Thank you.

7
Great suggestion! That's exactly what I needed. Thanks!

8
I have a vertical scroll view that I am populating with elements that are different heights. I was about to add code to dynamically position these elements within their parent container, which would be the child of the scroll view, but it occurred to me to ask if there was something like a UIGrid that can handle elements of different sizes. Does something like this exist? Or is positioning the items manually the only option?

Thank you.

9
NGUI 3 Support / Re: UI Scroll View items start at (0, -6428, 10)
« on: February 17, 2014, 12:27:01 PM »
Perfect. Thanks!

10
NGUI 3 Support / Re: UI Scroll View items start at (0, -6428, 10)
« on: February 17, 2014, 11:49:10 AM »
Thank you for your response.

That helped a bit. The grid now starts at (0, 0, 0), as expected. However, the grid script itself is deactivated, and I can't activate it.

This is what I have:

MyScrollView (UIPanel, UIScrollView, UIDragScrollView, BoxCollider, RigidBody)
-- MyGrid (UIGrid)
  -- List of instantiated prefabs (UIWidget, UIDragScrollView)

All of the instantiated prefabs just stack on top of each other, because the UIGrid is deactivated. How can I get this UIGrid functioning?

Thanks again!

11
NGUI 3 Support / Dynamically resizing widget
« on: February 16, 2014, 09:59:07 PM »
I have a UIWidget that needs to grow if its children exceed the bounds of its initial size. So if it is 300x300, but the span an area 400 pixels high, I would like the widget to resize itself to 410 or something. Is there a script or a widget available to accomplish such a thing? Or do I need to handle this myself?

Thank you.

12
NGUI 3 Support / UI Scroll View items start at (0, -6428, 10)
« on: February 16, 2014, 06:58:37 PM »
I've created a scroll view by doing the following:

1. NGUI > Create Scroll View
2. Named scroll view MyScrollView
3. On a button press, I instantiate a new ScrollItem prefab, and set it's transform.parent to MyScrollView.transform.

When I do this, my newly instantiated item is positioned at (0, -6428, 10), as are all subsequently instantiated items. Their prefabs have a position of (0, 0, 0), and even adding them to a UIGrid child of MyScrollView doesn't have any different effect (they just stack on top of each other at 0, -6428, 10).

In your instructional video here: http://www.youtube.com/watch?v=OiA4o8KqBFI, you add scripts like UIDragPanelContents, but those don't seem to exist any more. I have added UIDragScroll to my items, and the scrolling does work if I manually drag the items within the panel's viewable area, and they snap to the top of the list if I drag above it. I just can't seem to get them to start out that way (at the top of the list, as you would expect).

What might I be doing wrong?

Thank you.

13
NGUI doesn't seem to lend itself to external references. There's no DLL, and the Unity editor is so ingrained in the scripts that even compiling a DLL leads to all sorts of errors at run time. We want to move some of our functionality to an external library, so that it may span projects, but we're finding that we're unable to do this if we need to refer to a specific NGUI class (e.g. UIWidget). We could individually move the ones that we want out of the Unity side and into our library, but that would be need to be maintained and any updates to NGUI would need managing. Plus all of the editor stuff baked into the classes (e.g. the custom inspectors) generally cause problems.

I'm at somewhat of a loss on this. Is there a way to refer to an NGUI class in an external library? Or is this simply not possible?

14
NGUI 3 Support / Should I disable UIRoot if I'm using UIOrthoCamera?
« on: November 19, 2013, 01:19:19 PM »
I get a message saying that UIRoot should not be active at the same time as UIOrthoCamera. If I'm using UIOrthoCamera on my NGUI camera to maintain proper orthographic camera size, should I disable the UIRoot script on the main NGUI root?

Thank you.

15
NGUI 3 Support / Re: Upgrading to 3.0, some breaking changes
« on: November 12, 2013, 05:09:22 PM »
Thank you. Migration complete. I can already tell that I'm really going to like version 3.0!

Pages: [1] 2 3