How to center and right-align your text
Posted: Mon Jul 18, 2005 8:05 pm
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.
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.