Hello Guest

Author Topic: Scrollable Area - Looping Contents  (Read 4237 times)

Cherubyx

  • Newbie
  • *
  • Posts: 5
    • View Profile
Scrollable Area - Looping Contents
« on: February 06, 2015, 03:46:07 pm »
Hello,

I have looked all over the forum and Google searched on how to make the contents of a scrollable area loop.
I'm trying to implement an age selector system and I would like the months to loop back to 1 after 12.

Is this possible? I have scrollable area working with a tk2dUILayoutItems from 1 to 12 but they stop at the edges of 1 or 12.

Thank you!
Cherubyx

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Scrollable Area - Looping Contents
« Reply #1 on: February 06, 2015, 09:06:27 pm »
No, its not possible.
The easiest way to do it would be to add duplicates at either end of the list so you end up with 1..12, 1..12, 1..12
start showing the middle set, and when the scroll goes past the center list, you wrap around.

Cherubyx

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Scrollable Area - Looping Contents
« Reply #2 on: February 11, 2015, 02:01:12 pm »
Thank you, I'll try that out!

Cherubyx

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Scrollable Area - Looping Contents
« Reply #3 on: February 11, 2015, 04:20:09 pm »
Sorry for double post but this is kind of urgent. Is there a way to set the default Content UILayout item to start scrolling from? I don't want it to be the first UILayout item in the content list of a scrollable area.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Scrollable Area - Looping Contents
« Reply #4 on: February 11, 2015, 06:33:01 pm »
You an always get the position of the second - position of the first. That will give you the offset to the second.