For looooooong texts, the best way would be to break the text in a word list 
and display word by word (leaving spaces in between) starting with the first 
word that intersect the dispayng area and ending with the last one that still 
has space in the area. Then, with a Timer, move the virtual starting position 
one pixel at a time toward the left. I would also precompile the length of each 
word (including the right space) in the list to save time (a TStringList with 
Item=Value will do. Item will be the word, Value - the length. Alternatively, 
use Item and Object - object: the integer representing the length.) You may 
also "kill" the left word out of scope, and move the virtual starting possition 
to the beginning of the next word, which still intersects the canvas (this way, 
the computing time for each frame won't increase to the end of the text.)

I would add another challenge: use threads to display the text while feeding 
the end of the list with new texts. (Use threads anyway to let the user using 
the rest of the screen while dispayng the scrolling text!)

Horia


-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to