3d objs resolution indipendent

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Mancuso Raffaele
Posts: 70
Joined: Sat Dec 17, 2005 4:43 pm
Location: licata (AG) italy
Contact:

3d objs resolution indipendent

Post by Mancuso Raffaele »

hi all. I know how to make a 2d obj (button) resolution indipendent, but how about 3d object (text)? I try with this code, but it works with 2d objs and not with text

Code: Select all

double SXf(double val) {
	double rapport=(double)device->getVideoDriver()->getScreenSize().Width*(double)val;
	return (double)(rapport/(double)800.0); 
}
double SYf(double val) {
	double rapport=(double)device->getVideoDriver()->getScreenSize().Height*(double)val;
	return (double)(rapport/(double)600.0); 
}

void IniText() {
	//icon position
                //WORK!!!
	life_icon_position.X=SX(11);
	life_icon_position.Y=SY(450);
	//end of icon position

	//progress bars
               //DON'T WORK!!!
	life_progress_bar_pos.X=SXf(-3.85);
	life_progress_bar_pos.Y=SYf(-1.745);
	life_progress_bar_pos.Z=0;
bye
Bye all,
Mancuso Raffaele (Ares FPS game)
Post Reply