Author Topic: UIPopuplist current selection presented as a digit?  (Read 3432 times)

Vuoripeikko

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
UIPopuplist current selection presented as a digit?
« on: July 10, 2014, 07:28:56 AM »
Heyup, first of all, NGUI is an awesome asset and I've been using it for a project for some time now. I do have a problem now that I thought of asking here - is there a way of getting the number of your current choice from UIPopuplist? I know you can get the value as a string, but as an int?  ???

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPopuplist current selection presented as a digit?
« Reply #1 on: July 10, 2014, 09:11:57 PM »
Popup list always has a list of strings that it's working with. Assuming you need an index, UIPopupList.items.IndexOf("some value") will tell you the index.

Vuoripeikko

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: UIPopuplist current selection presented as a digit?
« Reply #2 on: July 14, 2014, 01:38:35 AM »
Thank you, it works like a charm.  ;D