Author Topic: Show selected items in a scrollist  (Read 3221 times)

DuaneDog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Show selected items in a scrollist
« on: March 05, 2014, 05:30:01 AM »
I'm getting closer to what I need. I've got a scroll list with my labels I've loaded from an array. They are centered instead of left justified but that is another issue. My next big question is how do I make it so I can select items in a scroll list. In the examples there is a lot on the paging, moving stuff around but I'm not seeing a real easy way to just make a list of items and then when one is selected it is highlighted in the list.

Thanks in advance for the help.

DuaneDog

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Show selected items in a scrollist
« Reply #1 on: March 05, 2014, 06:31:24 AM »
Easiest way? Don't just instantiate labels. Instantiate something like this:

Label
- Highlight Outline

Give your labels a box collider and a script that will show or hide the outline inside its OnSelect function. OnSelect(true) -- show it. OnSelect(false) -- hide it.

DuaneDog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: Show selected items in a scrollist
« Reply #2 on: March 05, 2014, 06:38:15 AM »
Excellent! Very helpful!