scrolling text box
Blitz3D Forums/Blitz3D Beginners Area/scrolling text box
| ||
Hola. Does anyone have an example of a scrolling text box with word wrap? No scroll bar - just the ability to arrow up and down to scroll through the text with a max of 5 lines or so visible. |
| ||
Would one of the GUI libs work for this? Sorry, I'm a noob at text and strings, just needing a wee bit of a hand here. I'm using Blitzplay Pro, and it has a few functions that adds text under the next line when Enter is pressed. Once the max lines are reached, the top one is deleted. I'm sure I'll need to edit the HandleMessages() function once I figure this all out, but I'm stumped. |
| ||
This is a scrolling example: For wordwrapping, look at gosse's wrapping functions. They are very nice: http://www.devcrunch.com/forum/viewtopic.php?t=19 |
| ||
Thanks bram32! I was thinking... if there's a possibility that a ton of text is going to be collected, would it be better for me to create a .txt file to hold the text and read it in real-time, then delete the .txt file upon program exit? |
| ||
I don't know. How much text are you expecting? I think you need to balance disk and memory usage during the program. You could also consider reading/writing text file in blocks. I mean, read or write say 256 lines in one turn, dispose them and then read the next 256 lines. This way the memory will hold only 256 lines the entire time and the program doesn't read the file too often. I believe that, in general, disk usage is slower than using memory. |