Home › Page › UghScrollView

UghScrollView

Revision for “UghScrollView” created on 31 May, 2013 @ 15:46 [Autosave]

Title
UghScrollView
Content
Inherits from <a title="UghControl" href="http://ugh.graveck.com/?incsub_wiki=ughcontrol">UghControl</a> The UghScrollView is a scrollable list of <a title="Unity Transform" href="http://docs.unity3d.com/Documentation/ScriptReference/Transform.html">Transforms</a>. <strong>This feature is in BETA right now. It may behave strangely right now, and we are working to fix any problems with it.</strong> [table caption="Variables" colwidth=20%|20%] name, type, description layoutDirection, LayoutDirection, Which direction the view scrolls. elementSpacing, float,"The spacing between elements, in Unity units. scrollVelocityFalloff, float,The speed at which a scrolling view comes to rest. enforcingVelocity, float,The speed at which the view snaps to back to the element in focus. enforceEdges, boolean,"If true, will enforce the edges of the view such that one element is always visible. snapPoint, Transform,"If <code>snapPaging</code> is enabled, this Transform will define the focus point to enforce the snap. snapPaging, boolean,"If true, will cause the element closest to the snapPoint to center on the snapPoint. snapPagingTimeout, float,UNUSED miniumSnapPagingSpeed, float,"If snapPaging is enabled, the minimum speed the mouse/touch must move before the view is allowed to scroll, in pixels/second. elementCount, int,The number of elements in the UghScrollView [/table] [table caption="Functions" colwidth=20%|20%] name, type, description AddElement, void, Add an element to the UghScrollView RemoveElement, void,Remove an element from the UghScrollView FindElementWithTransform,UghScrollViewElement,Finds an element in the UghScrollView and returns it GetElementAtIndex,UghScrollViewElement,return the element in the UghScrollView at the specified index AutoLayout, void,Automatically lays out the UghScrollView using the assigned variable information [/table] _ <strong>Using UghScrollView in script</strong> UghScrollView is primarily set up in the inspector view. For more info on how to set one up, see the tutorial <span style="text-decoration: underline;">here.</span> The UghScrollView can also be set up and handled dynamically in script. <strong>UghScrollView Scripting Functions</strong> [sourcecode language="csharp"] public void AddElement(Transform obj) public void AddElement(UghScrollViewElement element) &lt;em id=&quot;__mceDel&quot;&gt;[/sourcecode] Adds a Transform to the view surface.  This function will take the supplied Transform and wrap it in an UghScrollViewElement before adding it to the view.  An overloaded version exists if you already have access to an UghScrollViewElement instance. [sourcecode language="csharp"] public RemoveElement(UghScrollViewElement element) [/sourcecode] This function removes the specified UghScrollViewElement from the view surface.  (Use FindElementWithTransform to look up an UghScrollViewElement.) [sourcecode language="csharp"] public UghScrollViewElement FindElementWithTransform(Transform search) [/sourcecode] Searches all of the UghScrollViewElements in the view surface and returns the instance that contains a reference to the supplied Transform.  If none is found, this function will return null. [sourcecode language="csharp"] public UghScrollViewElement GetElementAtIndex(int index) [/sourcecode] Given an index, this function will return the associated UghScrollViewElement.  If no element is associated with the index, the function will return null.  Note that the index reflects the order in which the UghScrollViewElement was added to the view surface, and has no relation to its position on in the view. <strong>Using the AutoLayout function</strong> UghScrollView has a context menu option "Auto Layout."  Selecting this from the inspector's context menu will cause the UghScrollView to sort and align its contents.  The sorting and alignment is based on the specified layoutDirection.  Note that this sorts the list of UghScrollViewElements, thus changing their index with respect to the GetElementAtIndex function.
Excerpt


OldNewDate CreatedAuthorActions
31 May, 2013 @ 15:46 [Autosave] admin
31 May, 2013 @ 15:45 admin
17 April, 2013 @ 19:15 admin
17 April, 2013 @ 19:14 admin
17 April, 2013 @ 18:32 admin
9 April, 2013 @ 21:45 admin
2 April, 2013 @ 15:29 admin
29 March, 2013 @ 19:12 admin
29 March, 2013 @ 19:07 admin
29 March, 2013 @ 18:43 admin
29 March, 2013 @ 18:41 admin
29 March, 2013 @ 18:36 admin
29 March, 2013 @ 18:36 admin
29 March, 2013 @ 18:33 admin
29 March, 2013 @ 18:32 admin
29 March, 2013 @ 18:22 admin
18 March, 2013 @ 16:40 admin
18 March, 2013 @ 16:39 admin
18 March, 2013 @ 16:39 admin
11 March, 2013 @ 22:39 admin
11 March, 2013 @ 20:16 admin
11 March, 2013 @ 20:11 admin
11 March, 2013 @ 17:10 admin
11 March, 2013 @ 17:09 admin
11 March, 2013 @ 16:31 admin
11 March, 2013 @ 16:28 admin
11 March, 2013 @ 16:25 admin
11 March, 2013 @ 16:24 admin
11 March, 2013 @ 15:36 admin
11 March, 2013 @ 15:22 admin
11 March, 2013 @ 15:18 admin
11 March, 2013 @ 15:16 admin
11 March, 2013 @ 15:14 admin
8 March, 2013 @ 23:00 admin
8 March, 2013 @ 22:58 admin
8 March, 2013 @ 22:57 admin
8 March, 2013 @ 22:57 admin
6 March, 2013 @ 21:52 admin
6 March, 2013 @ 21:51 admin