Author Topic: UIDragPanelContents added at run-time inexplicably disappearing  (Read 3477 times)

Teric

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 7
    • View Profile
I am attaching objects with UIDragPanelContents components to a UIGrid during run time.  The UIGrid is a child of a UIDraggablePanel.  The UIDraggablePanel has a clipping area set to 'hard clip'.

The UIDragPanelContents widgets are all disappearing from view when the panel is at rest (i.e. not being dragged).  When I drag the contents down a bit (thereby exposing the blank area above the top of the list), the items suddenly appear.  But when I release the drag and the items spring back into place, they disappear again.  (Please see attached screenshots).

If I drag the contents upward so I can see the lower items in the list, the list items remain completely invisible.  It is as if the entire list is being clipped out, even though only one or two list items are hitting the upper bound of the clipping area.

Any idea why this may be happening?

I believe I am setting up the list items properly:
  1.                 var masterDragPanel = this.transform.GetComponent<UIDraggablePanel>();
  2.                 masterDragPanel.ResetPosition();
  3.  
  4.                 var itemHistoryList = ItemLog.Entries;
  5.  
  6.                 foreach( var entry in itemHistoryList )
  7.                 {
  8.                         var newHistoryItemObj = NGUITools.AddChild( itemHistoryGrid.gameObject, historyItemPrefab );
  9.                         var dragPanelContents = newHistoryItemObj.GetComponent<UIDragPanelContents>();
  10.                         dragPanelContents.draggablePanel = masterDragPanel;
  11.                 }
  12.  
  13.                 itemHistoryGrid.Reposition();
  14.                 masterDragPanel.UpdateScrollbars( true );
  15.                 masterDragPanel.ResetPosition();
  16.  

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: UIDragPanelContents added at run-time inexplicably disappearing
« Reply #2 on: April 12, 2013, 07:28:16 PM »
Two different materials at the same z position. Put one of them at -1.


Also don't use hardclip - use alphaclip instead. Better in every way.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIDragPanelContents added at run-time inexplicably disappearing
« Reply #3 on: April 12, 2013, 08:25:11 PM »
Hard clip has been disabled many months ago. It defaults to alpha. ;)

Teric

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: UIDragPanelContents added at run-time inexplicably disappearing
« Reply #4 on: April 17, 2013, 10:10:06 AM »
The same result occurs with both hard- and alpha-clip.  Also, I've tried setting the z-values between +500 and -500, and it doesn't make a difference.

tomhog

  • Guest
Re: UIDragPanelContents added at run-time inexplicably disappearing
« Reply #5 on: April 17, 2013, 11:05:11 AM »
Hi

Think I'm experiencing something similar, my content were disappearing (sometimes just moving behind the background).

Adding a depth pass to the content panel has helped but now I'm getting issues with alpha clipping.

Checkout my post

http://www.tasharen.com/forum/index.php?topic=3874.0

Thanks
Tom

Teric

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: UIDragPanelContents added at run-time inexplicably disappearing
« Reply #6 on: April 17, 2013, 11:49:32 AM »
I tried adding a depth pass, but the result was the same.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIDragPanelContents added at run-time inexplicably disappearing
« Reply #7 on: April 17, 2013, 12:41:40 PM »
At run time check the position of your draggable panel. Chances are its Z position is back to 0.

Teric

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: UIDragPanelContents added at run-time inexplicably disappearing
« Reply #8 on: April 17, 2013, 12:51:36 PM »
I set the z-position of the draggable panel to -300.  At run time, it is still set to -300.  When I drag it down, the items now appear in front of the buttons at the bottom of the app.  However, when I release the list, it again disappears as before.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIDragPanelContents added at run-time inexplicably disappearing
« Reply #9 on: April 17, 2013, 03:42:35 PM »
-300 is pretty massive. Have you tried tilting the scene camera to get a better idea of what's happening?