Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: primus88 on June 10, 2014, 02:48:58 PM

Title: How to center on an item in a scroll list
Post by: primus88 on June 10, 2014, 02:48:58 PM
Hello,

I have something like a journal implemented in my game.
This journal is in fact a list of topics on one side included in a scrolling list. It works ok as if i click a topic, on the right side the respective detailed journal entry appears.
What I need extra is that if for example I unlock a new journal entry (topic), when I open the list of topics, on the right side I already have the latest unlocked journal entry.

Right now, no matter how many topics I unlock, when I open the scrolling list, only the first one is opened by default.

Thanks
Title: Re: How to center on an item in a scroll list
Post by: primus88 on July 08, 2014, 04:28:03 AM
Anyone, please?
Title: Re: How to center on an item in a scroll list
Post by: ArenMook on July 08, 2014, 12:20:51 PM
Have you looked at UICenterOnClick script? It does just that.
Title: Re: How to center on an item in a scroll list
Post by: primus88 on July 08, 2014, 01:37:54 PM
No, it's not that. I already have this script attached.

Ok, let me put it another way. You know the UIToggledObjects ? Well i use that in order to have a label shown when i click on the tab.
It works very nice, but what I want is that when I open this dragable list, to have already the latest label shown, instead of always having the first one, no matter how many newer labels I have.
Title: Re: How to center on an item in a scroll list
Post by: ArenMook on July 09, 2014, 02:44:44 PM
Right, I mean the code to do what you want is in UICenterOnClick. If you want it to navigate to a specific label, just look at the code used in that script and do the same thing.