Author Topic: Issues with "Restrict Within Panel" in UIDraggablePanel  (Read 3720 times)

tommy.izaguirre

  • Guest
Issues with "Restrict Within Panel" in UIDraggablePanel
« on: July 13, 2012, 11:01:22 AM »
I have a UIDraggablePanel with a UIGrid child.  The UIGrid has no children at startup. 

During runtime, I am adding UIDragPanelContents as children to the UIGrid. Each UIDragPanelContents also has a 3D Model child attached to it. The intent is to create a scrollable list of 3D Models.  The list is actually working as is.  I am able to scroll through my list and select the objects in it.

The specific issue is that checking "Restrict Within Panel" seems to have no effect on the contents of the UIDraggablePanel.  Objects scroll freely off the screen.  I am unsure what is causing the issue but I am wondering if it related to the lack of "UIWidgets" in my UIGrid.

Visual info about the relationships:
> Panel
  > UIDraggablePanel
    > UIGrid
      > UIDragPanelContents
        > 3D Model
      > UIDragPanelContents
        > 3D Model
      > etc.

Has anyone attempted to implement a draggable list in this way and/or seen any similar issues?  Any help is appreciated and please ask if more information is needed.

Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Issues with "Restrict Within Panel" in UIDraggablePanel
« Reply #1 on: July 13, 2012, 11:53:30 AM »
The script only works with UI widgets, not 3D models.

tommy.izaguirre

  • Guest
Re: Issues with "Restrict Within Panel" in UIDraggablePanel
« Reply #2 on: July 13, 2012, 01:09:48 PM »
The script only works with UI widgets, not 3D models.

Thanks for the reply.  I had assumed that the lack of widgets was the culprit.  Would it be possible to attach a dummy widget to the UIDragPanelContents along with the 3DModel to get this working? If so, how would that look?  I've tried simply attaching a UIWidget, but it doesn't seem to have any effect on the behavior.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Issues with "Restrict Within Panel" in UIDraggablePanel
« Reply #3 on: July 13, 2012, 02:17:06 PM »
You might be better off writing custom logic here. NGUI's dragging / panel system was designed to work with widgets, not models. Clipping won't work with your 3D models either, btw. You could add dummy "background" widgets though, I suppose. Think -- creating "cells", which are actual sliced sprites... and beside them add your 3d models so that they show up right on top.

tommy.izaguirre

  • Guest
Re: Issues with "Restrict Within Panel" in UIDraggablePanel
« Reply #4 on: July 16, 2012, 09:27:49 AM »
I reworked some of the logic within UIdraggablePanel so that the bounds are not determined by the widgets parented to the panel.  It is working now.  Thanks.