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

Pages: [1] 2 3
1
oh Aren btw on an off topic note, theres a function called GetExactCharacterIndex in NGUIText.cs that returns a default 0. This means that it reports a valid index in situations where it couldn't find a url when you GetUrlFromPosition(lastmouseindex). This should probably be -1? At least seems to have fixed it for me.

2
No there is no animation going on and also I had checked all the way up to the parent for scale 0.
I fixed it though. Not exactly sure what was going on but before(and I'm using NData) when a second item of the type was added, I was clearing out the list and then creating a fresh list with that item's count set to +1. Now instead of clearing out the list, I simply set the NData's binding to +1 and the positioning got fixed. I feel like there might exist some situation where the draw call happens before the anchoring takes place and that puts the content off bounds. Must be quite rare though.

3
Hi guys
So I have a UIGrid that has contents.
UIGrid
         -- 0
         -- 1

The content structure looks like this
UIWigdet
             ---UITexture
             ---GameObject
                                   ---UIPanel
                                                  ---Children
             ---UIPanel(***This UIPanel seems to create all kinds of problems)
                            ---UILabel
                            ---UISprite   

The clipping on the problematic UIPanel is set to None. I have it there only cause of depth reasons. I need the UILabel and UISprite to be on top of the first UIPanel.

Now the problem is when I add a second entry to the UIGrid, the UILabel and UISprite on the second entry are completely off. Note that their location is correct, meaning if you were to select the UILabel or UISprite in Unity editor, the bounds as indicated by Ngui's blue dots seem to be in the correct place. However their content is off of this outlined bounds. The moment there is any sort of refresh, by resizing the Game window, Grid's execute or UIScrollView's Reset clipping plane, the contents shift to their proper position.

Any thoughts if this is a bug? Whats going on?

Thanks

4
I actually ended up using the ScreenToPixels and the localCorners on the widget. Seems to work fine so far. The screen to world to local wasn't giving me correct results for some reason(I was passing in the same camera for world and ui. wonder if it was something to do with that).

5
I meant through code. I'll be having multiple colliders on top of this base collider and hence I can't rely on the mouseout callbacks from the base collider alone.

6
Hi guys
I basically am going to be getting a callback upon which I want to know whether its within my widget bounds or not.
I did GUIMath.ScreenToPixels (UICamera.lastTouchPosition,alphaPanel.transform)
I guess the numbers this returns could be checked against the widgets pixel width and height but I can't seem to find a way to get that.
Thoughts?
Help appreciated.
Thanks

7
Ok.
Also in reference to "It would, yes. However for any of this to work, the content must be already present in the scroll view's panel's list. If you instantiate content, it won't actually be added to the panel's list until later. If you want it to be right away, you need to Broadcast("CreatePanel") to the instantiated object."

How can I know when my instantiated content has been added to the panel's list?
Or as another option how do I do this Broadcast("CreatePanel")? You said broadcast to the instantiated object. Shouldn't it be the instantiated object broadcasting to the panel?

8
I'm also noticing that the problems with vertical positioning only happen when there is content less than the size of the panel.

If there is more content than can fit within the panel's region, it seems to position just fine. Any thoughts why it behaves like this. Or is just that processing takes longer with more content(enough to allow the uitable/grid to position itself?)

9
Honestly I do believe that reposition on my table/grid is being called after adding my content(I'm using Ndata->ItemsSourceBinding). Perhaps the problem is that it gets called too early right after adding content. Perhaps it needs to be called after a certain amount of time.
I sort of solved it by doing a half second delayed reposition on the table/grid but it leads to an ugly shift of the contents. I think its very important for the positions to be correct before content is added otherwise its gonna lead to glitchy twitchy look and feel.

Also I was hoping that the call to scrollbar's UpdateScrollbar from UITable/UIGrid's Reposition would take care of positioning on the scrollview. Would it not? Please definitely let me know about this.(I will continue experimenting)

You know what, I'm gonna try repositioning it before adding any content to it. Hopefully it positions it properly such that when the first piece of content is added to the scrollview it comes up in the right place.

10
Hi guys
I'm noticing that for many of my cases, after my first insert in a UITable/UIGrid the entry gets put wherever(vertically) within the clipping panel.
Its only after I do a Reset Position on the scroll view(which shifts the scrollview y upwards) does it properly move to the top.
I'm trying to figure out if others have experienced this as well or if its just me due to my setup.
The way I have it set up is

Panel with soft clip|UIScrollView(The panel has anchors defined)
|
UITable/UIGrid

I usually make it look correct in the scene(by test adding an item under UITable/UIGrid then deleting it after all positioning is done).
I sometimes wondered if some anchoring on a parent was messing things up. But irrespective of that I believe when an item gets added it calls to reset position on the scrollview right?
Shouldn't that take care of things?

Thanks

11
need include was a typo. Sorry. I meant to say why did you not include. Anyways looks like its fixed now.
Cheers..

12
Out of curiosity why did you need include this code for updating scrollbars in UIGrid's ConstrainWithinPanel already?
Seems like you would need to this on Reposition no? UITable has it.

Also not sure why you mentioned NGUITools.ImmediatelyDrawCall stuff here. How am I supposed to use it for this particular case?

Thanks

13
Okay I'll start doing it like having widget as parent.
I had 1 situation where the top parent was a gameobject and it had 2 optional(only 1 active at at a time) and UITable seemed to be treating the 2 children as independent children of its contents. This was until I put a UIWidget on the parent gameobject.

When I said created dynamically, I just meant instantiated dynamically from a prefab. Sorry for the confusion.

14
Btw, seems like UITable talks to the UIScrollView to dynamically update the scrollbar. Should this not happen with UIGrid as well?

15
Hi

So I see that if you dynamically add contents to UIGrid in your scrollview and if that content takes a bit to load up, the scrollbar is non-functional(It perhaps thinks there is not enough content to scroll).

So fine I'll call ResetPosition. But the problem is that if you call it just directly its useless. You have to wait for some time until something gets done before you can call it.

Since I don't want to just blindly wait for x amount of time I wanted to know upon what can I reliably call ResetPosition on ScrollView?

Thanks

Pages: [1] 2 3