Center of the viewport!

Posted By: fireapach3

Center of the viewport! - 01/20/10 10:48

Hey everybody! How can i do to calculate the center of the viewport independent of the resolution of the game?

PS: I've tried using screen_size, but without success... ¬¬

Code:
video_mode = 8;

int centrox = screen_size.x * 0.5;

if(centrox == 512)
{
   "do it"
}


Posted By: DJBMASTER

Re: Center of the viewport! - 01/20/10 11:07

I assume this is inside the 'main' function. You need a 'wait(1);' after 'video_mode = 8' because you need to give the directX device 1 frame to set up the vars.
Posted By: fireapach3

Re: Center of the viewport! - 01/20/10 13:06

Wow! Thanks! XD
© 2023 lite-C Forums