Custom Textfield Function

BlitzMax Forums/BlitzMax Beginners Area/Custom Textfield Function

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

I've this rough idea:

* have one string of a subparagraph, this is the string in which you can type/modify directly. Your whole text is made out of multiple subparagraphs put after each other.

* format the string, wrap words, and output each visual line to an array. So if your subparagraph spans 5 lines, then you'll have 5 arrays. You store these 5 arrays in a the same object as your subparagraph string.

* Now you have the input string, and a formatted version in a format you can browse through, while you never need to adjust the formatting on-the-fly.

As a result, the text is roughly twice in memory, but in today's machines it hardly matters, esp. as you didn't intend to write a whole novel in that game screen.