Author Topic: How to jump to the last chat message  (Read 4164 times)

laurentl

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 188
    • View Profile
    • McDROID
How to jump to the last chat message
« on: April 20, 2013, 05:17:57 AM »
Using UITextList, how do I jump to the last message entered?
I'd like to have it work this way : when a player enters a text, it automatically scrolls to that message if the player scrolled up.
I cannot find a method to do that, my guess is - gotta code it yourself but I don't even know how it scrolls...

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to jump to the last chat message
« Reply #1 on: April 20, 2013, 09:06:50 AM »
UITextList is just an example. I recommend creating your own chat system. I did that myself for both Windward and Starlink.

ReliC

  • Guest
Re: How to jump to the last chat message
« Reply #2 on: April 20, 2013, 09:56:06 AM »
For my prototype the UITextList worked great. To get it to automatically scroll to the last entry, I made a copy of UITextList and modified it (made other changes too, it's a great example to work from). All you need to do is set mScroll = 0 in the Add() method right before the call to UpdateVisibleText(). Then, whenever a new message is added, no matter where the user is in the scroll buffer, it will scroll to the last entered message.

Hope that helps!