text actor view centering problems

Non-platform specific questions.

text actor view centering problems

Postby sonicfire » Tue Apr 12, 2011 1:29 pm

hi folks!

i´m using this function and somehow i have problems with it:
Code: Select all
void centerMeX()
{
    x = view.x+(240-width*0.5); // ?
}


somehow its too far to the right. cant explain it.
is there a once-and-for-all centering function that works with normal AND textonly actors??

any help much appreciated! :)
EDIT: my screen (view) is 480x320
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Re: text actor view centering problems

Postby sonicfire » Tue Apr 12, 2011 7:16 pm

anyone?? :?
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Re: text actor view centering problems

Postby Game A Gogo » Tue Apr 12, 2011 8:02 pm

x=view.x+view.width*.5-width*.5;
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest