Author Topic: UIWrapContent - Multiple Lines?  (Read 2240 times)

doncarlos91

  • Newbie
  • *
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 27
    • View Profile
UIWrapContent - Multiple Lines?
« 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

wud

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: UIWrapContent - Multiple Lines?
« Reply #1 on: October 26, 2016, 02:00:47 AM »
if i know what you want, you can group the item in one col?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIWrapContent - Multiple Lines?
« Reply #2 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.

doncarlos91

  • Newbie
  • *
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: UIWrapContent - Multiple Lines?
« Reply #3 on: November 02, 2016, 02:57:11 AM »
Thanks  Aren, it works !!

lastkingssaint

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: UIWrapContent - Multiple Lines?
« Reply #4 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIWrapContent - Multiple Lines?
« Reply #5 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.