Author Topic: alignement  (Read 2035 times)

Offline bricky91

  • Mc. Print
  • *
  • Posts: 47
    • View Profile
alignement
« on: 2008-Feb-01 »
Hi! i have another question: is it possible to set the alignement of the text??
thanks bye :)

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1790
    • View Profile
    • Homepage
alignement
« Reply #1 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 :-)

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5069
  • O Rly?
    • View Profile
I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline bricky91

  • Mc. Print
  • *
  • Posts: 47
    • View Profile
alignement
« Reply #3 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 :)