Author Topic: UIDraggablePanel not showing on startup.  (Read 6552 times)

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
UIDraggablePanel not showing on startup.
« on: June 05, 2012, 11:00:46 PM »
Ok, so I now have my perfectly UIDraggablePanel up and working, the last problem I have to fix is that when I first startup, all the objects are positioned way off to left. When I first click in the UIDraggablePanel everything pops into view. But until I do so, the entire panel is empty. I have fiddled with all the settings and everything seems ok. The left and right colliders, the size of the UIDraggablePanel etc, but sadly nothing comes into view, and when I try to manually reposition the items, once I click run they all move offscreen again.

I created my UIPanel by dragging in the one from the tutorial and then readjusting everything to fit my window. I can only assume that is what the problem is, although I can't tell for sure. Any ideas on how to get the screen to appear correctly?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIDraggablePanel not showing on startup.
« Reply #1 on: June 05, 2012, 11:37:24 PM »
Make sure the clipping bounds are correct and that the object inside is positioned properly to start with (is it a UITable perchance?).

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: UIDraggablePanel not showing on startup.
« Reply #2 on: June 06, 2012, 12:09:16 AM »
It isn't a UITable, just a UIPanel

My UIPanel (Clipped View)

has a transform of 0,0,0
Cell Width 330
Cell Height 180

UIPanel (Window)

also has a transform of 0,0,0

The Outline has a size of 650, 200 and is positioned up -115 in the Y direction (problem is with X direction though) Box Collider is scale 1,1,0

It positions perfectly on my window size as I can see it with the purple outline, The two colliders at the left and right are positioned either side against the purple box. Box Colliders are both size 200,300, both at transform 0,0,0

The UIPanel (Scroll bar) which I guess has no relevance has nothing strange in it.

Can't see anything strange there at all.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIDraggablePanel not showing on startup.
« Reply #3 on: June 06, 2012, 02:18:48 AM »
Panels don't have a cell width or height. Do you mean a grid?

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: UIDraggablePanel not showing on startup.
« Reply #4 on: June 06, 2012, 02:48:35 AM »
Sorry yes, that is the dimensions from the Clipping Soft Clip Size not the Cell Width.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIDraggablePanel not showing on startup.
« Reply #5 on: June 06, 2012, 03:28:11 AM »
So you have one panel nested inside another? You know that clipping is not hierarchical, right? Clipping only works for widgets that are parented to the panel. It doesn't affect nested panels.

joreldraw

  • Guest
Re: UIDraggablePanel not showing on startup.
« Reply #6 on: June 06, 2012, 04:05:27 AM »
I have similar issue but i have a table.

In my hierachy i have some labels , each with a background and the panel have a scale tween.
When i play to show the panel sometimes the background go out of her position, i reopen and go to her original position...

I think is something related with playing tween , if i navigate slow work better that i navigate fast.


ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: UIDraggablePanel not showing on startup.
« Reply #7 on: June 06, 2012, 04:29:34 AM »
I think that everything should be working fine. I literally just duplicated the scroll view from your "Example 7 - Scroll View (Panel) project into mine. Everything was all working ok, until I changed the contents of the Item List and the size of the Window Dimensions.

joreldraw

  • Guest
Re: UIDraggablePanel not showing on startup.
« Reply #8 on: June 06, 2012, 05:37:06 AM »
In my case i discover now that i get error when i not have childrens in the table to fill the dragable panel dimension...

Any idea?

Modified to add video with the problem...

« Last Edit: June 06, 2012, 05:50:48 AM by joreldraw »

joreldraw

  • Guest
Re: UIDraggablePanel not showing on startup.
« Reply #9 on: June 06, 2012, 07:55:49 AM »
Well how i see on another post of the today famous subject "table" i reemplace UITable for UIGrid and work fine to me now.

But i like to know why Table fail and i think now that Grid work, that this is a table bug.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIDraggablePanel not showing on startup.
« Reply #10 on: June 06, 2012, 02:53:08 PM »
Table has an option to update the panel on Reposition (ConstrainTargetToBounds, line 142 of UITable.cs). It's necessary in order to update sync with the scroll bar when the content of a table changes in size. The grid doesn't do this.

You can try commenting out that part, but all the posts aside I've yet to get a reproduceable case showing the problem. If you can make a simple one, it would help me understand where the issue lies and how to fix it.

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: UIDraggablePanel not showing on startup.
« Reply #11 on: June 10, 2012, 11:27:54 PM »
Well I finally figured out my problem and naturally it was my own and not NGUI.

All of the objects inside my "Item" object were all set to 700 for some unknown reason. Naturally reordering the list using the reorder now button only affects the main Item object and not its children. I can only assume I created a Item, had it reordered and then duplicated the Item which was at 700.

No idea why this transferred to its children (unless I was editing the list during runtime and saved an asset) or why how when I started and clicked the window it magically set them all back to 0. But anyway, that is what my problem was. I figured it out whilst trying to reproduce the problem to send to you.

Not sure about joreldraw's problem but at least mine is fixed now. :)

joreldraw

  • Guest
Re: UIDraggablePanel not showing on startup.
« Reply #12 on: June 11, 2012, 03:49:31 AM »
I update now to 2.08 and the error at the moment is solved...
Not sure what happen. I go to test with my menu and if i go again an error i tell you.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: UIDraggablePanel not showing on startup.
« Reply #13 on: June 11, 2012, 08:49:33 AM »
It can help to do a .Refresh() on the UIPanel, and a RestrictWithinBounds(false) on the UIDraggablePanel afterwards - that tends to snap things back into place.

joreldraw

  • Guest
Re: UIDraggablePanel not showing on startup.
« Reply #14 on: June 11, 2012, 09:38:14 AM »
I get again the error, i try restrictwithin to false and same error.
In my hierachy my subpanel are checkbox, and the sprite that disapear is the background img . Can have checkbox anything that not work with table?