GLBasic forum

Main forum => GLBasic - en => Topic started by: bricky91 on 2008-Feb-01

Title: alignement
Post by: bricky91 on 2008-Feb-01
Hi! i have another question: is it possible to set the alignement of the text??
thanks bye :)
Title: alignement
Post by: Moru on 2008-Feb-01
I'm affraid you have to align text yourself. Each character is a certain width, you can get the size of the font with the command:

GETFONTSIZE x, y

And with this command:

LEN(str$)

...you can find out how many characters there is in your string that you want to print. Use this to calculate the total size of the string in pixels and position it right, centered or left aligned. Left and right-justified text (both margins straight) is a bit trickier and not realy worth the work in my view :-)

Let us know if you want more hints :-)
Title: alignement
Post by: Schranz0r on 2008-Feb-02
http://www.glbasic.com/forum/viewtopic.php?id=822

;)
Title: alignement
Post by: bricky91 on 2008-Feb-02
thanks moru, and thanks schranz0r! i saw the link to the other topic only now that i've already made it by myself... however, i'm happy to see that i did it like was explained in the topic, so it means i understood well how to do it! thanks again, guys! bye :)