How to center and right-align your text

Game Editor comments and discussion.

How to center and right-align your text

Postby BeyondtheTech » 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.
Last edited by BeyondtheTech on Tue Jul 19, 2005 3:12 am, edited 1 time in total.
User avatar
BeyondtheTech
 
Posts: 270
Joined: Wed Mar 30, 2005 6:34 am
Location: Edison, NJ
Score: 4 Give a positive score

Postby Just4Fun » Mon Jul 18, 2005 10:12 pm

Thanks for the tip! :D
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby jazz_e_bob » Tue Jul 19, 2005 9:47 am

Good one mate.

8)
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby ingsan » Wed Jul 20, 2005 9:04 am

Thanks a lot :)
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest