line text justify

BlitzPlus Forums/BlitzPlus Programming/line text justify

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

What you need to know are:

1. The width of the screen
2. The width of your text
3. The number of spaces in your line of text

Subtract the length of the text from the width of the screen. The difference then needs to be divided by the number of spaces you have.

The last figure is then the additional amount you need to add whenever you find a space during the drawing of your text.

I'd calculate the x co-ordinates as floats, so any rounding won't mess up the positioning of your text.

Hope that helps.