CodeBase - Multi Line Text wrapped in a box.

Return to the CodeBase listing

Category: Text

Version: 1.0



Uploaded: 19th Sep 2003 20:40

Modified: 19th Sep 2003 20:44

Author:  =C=


Converts a long single line to and image of the Text wrapped in a box.

Full Description

It is faster to paste an image than write text line by line in the main loop. Prepare your text in a multi line wrapped box first and then just paste the text image on the screen.<br /> <br /> What the code does is:<br /> 1. Gets a long string<br /> 2. loop and break it in sections<br /> 3. check if the section ends in space or reduce it until it does.<br /> 4. write the text in a bitmap<br /> 5. crop the bitmap so the text is &quot;boxed&quot; as an image<br /> 6. return the image<br /> 7. main loop just pastes the image on the screen (bitmap 0)<br /> <br /> Step three is the second function call.<br /> <br /> I also get up to 72 FPS instead of 66 that is in the screenshot being the minimum I saw...


No comments yet.