Page 1 of 1

How to center and right-align your text

PostPosted: Mon Jul 18, 2005 8:05 pm
by BeyondtheTech
In case you didn't know, you can center or right-align your text once it's generated on screen.

Example:

strcpy(actor1.text, "I'm right-aligned!");
actor1.x = view.width - actor1.width;

strcpy(actor2.text, "I'm centered!");
actor2.x = (view.width/2) - (actor2.width/2);

This makes good for formatting your score, or making credits, etc.

PostPosted: Mon Jul 18, 2005 10:12 pm
by Just4Fun
Thanks for the tip! :D

PostPosted: Tue Jul 19, 2005 9:47 am
by jazz_e_bob
Good one mate.

8)

PostPosted: Wed Jul 20, 2005 9:04 am
by ingsan
Thanks a lot :)