Jump to content




Scrolling Text


  • You cannot reply to this topic
3 replies to this topic

#1 hbomb79

  • Members
  • 352 posts
  • LocationOrewa, New Zealand

Posted 30 December 2014 - 09:32 AM

In my adventures of instant messaging I want a GUI that displays the messages in a list most recent at the bottom, oldest at the top, depending on the size of the message etc.. I can see problems in it, for instance how would I work out the last message, I thought maybe put all the messages in a table then display the most recent 5 or 6, but the issue of large text remains. Any help on this would be great

For reference I am aiming for something like Skypes IM UI.

Haven't got any code as I've just been messing around and cant really get very far...

#2 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 30 December 2014 - 11:42 AM

You're heading to the right direction, the best way is probably just storing messages into a table. Now about multiline messages. You could make a function which would wrap the text around the screen width. Then you would apply some math to calculate which messages and which parts of messages to show according to screen size, scroll value and the messages themselves. I hope this helps to at least get an image about how you should address this problem :)

Edited by MKlegoman357, 30 December 2014 - 11:43 AM.


#3 metron80

  • Members
  • 55 posts
  • LocationSolitude, Skyrim

Posted 03 January 2015 - 05:53 AM

Perhaps this post should help you:

http://www.computerc...__fromsearch__1

I needed help with this same problem, and made that post.

#4 SquidDev

    Frickin' laser beams | Resident Necromancer

  • Members
  • 1,427 posts
  • LocationDoes anyone put something serious here?

Posted 03 January 2015 - 10:30 AM

There are two implementations I can think of:

The first one is as MKlegoman357 suggested. Just store the messages in a table work out where you should start printing from. This could be harder to work with but probably would run quicker than the alternative.

The (probably) easier solution is to use a buffer of some sort. I wrote a little implementation for ElvishJerricco's ClamShell. This uses an adaptation of Lyqyd's framebuffer. The buffer is here and example usage can be found here.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users