Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: doncarlos91 on October 25, 2016, 05:36:22 AM

Title: UIWrapContent - Multiple Lines?
Post by: doncarlos91 on October 25, 2016, 05:36:22 AM
I have organized my content like this :

UIWrapContent
-- Item 1
-- Item 2
-- Item 3
-- Item 4
-- Item 5
-- Item 6

and i just want to make it like this horizontal grid :

UIWrapContent
-- Item 1   -- Item 2   -- Item 3
-- Item 4   -- Item 5   -- Item 6

there are some ways to do it with UIWrapContent ?
before i have used UIGrid component , but performance was    awful with a lot of data :)

Thanks
Title: Re: UIWrapContent - Multiple Lines?
Post by: wud on October 26, 2016, 02:00:47 AM
if i know what you want, you can group the item in one col?
Title: Re: UIWrapContent - Multiple Lines?
Post by: ArenMook on October 30, 2016, 12:03:01 PM
Each row would need to be a separate item, just containing 3 visible elements. When setting the data, take into account that each item has 3 elements rather than 1.
Title: Re: UIWrapContent - Multiple Lines?
Post by: doncarlos91 on November 02, 2016, 02:57:11 AM
Thanks  Aren, it works !!
Title: Re: UIWrapContent - Multiple Lines?
Post by: lastkingssaint on November 15, 2016, 11:25:30 PM
Aren, sorry to jump in here, but could i get some clarification on that? I see that in example 14 the wrap content wraps the circularly, but im confused on how to get an item list that goes:
UIWrapContent
-- Item 1   -- Item 2   -- Item 3
-- Item 4   -- Item 5   -- Item 6
-- Item 7   -- Item 8   -- Item 9

My goal is to write a script that will loop through images and assign them to each item, then allow the user to scroll down the list. Any help would be very welcomed.
Title: Re: UIWrapContent - Multiple Lines?
Post by: ArenMook on November 19, 2016, 07:01:16 AM
Exactly as you printed it:

UIWrapContent
-- Row A
----- Item 1
----- Item 2
----- Item 3
-- Row B
----- Item 4
----- Item 5
----- Item 6

Your rows are just game objects containing children (items). When you initialize each new item, treat it as 3 not just 1. For example if you get index of 3, it means you're actually going to have the content items start at 3*3=9.