Splitscreen with different resolutions

Posted By: 3run

Splitscreen with different resolutions - 11/13/10 23:09

I've made simple splitscreen with two views like this:
Code:
VIEW* camera1 = // top 
{
	layer = 15;		
        arc = 80;
	pos_x = 0; 		
        pos_y = 0; 
	size_x = 800;	
        size_y = 300;
	flags = SHOW;
}

VIEW* camera2 = // bottom 
{
	layer = 15;		
        arc = 80;
	pos_x = 0;		
        pos_y = 300; 
	size_x = 800;	
        size_y = 300;
	flags = SHOW;
}

But, how can I make views size change automatically depending on the screen resolution? Do I need to use 'screen_size'? Thank you.
Posted By: Quad

Re: Splitscreen with different resolutions - 11/13/10 23:48

yes you need to use screen size, but you cannot use that in the definition of the view you have to do that in a function like

camera.size_y = camera2.size_y = screen_size.y/2;
camera2.pos_y = screen_size.y/2;
Posted By: 3run

Re: Splitscreen with different resolutions - 11/14/10 06:16

Thank you Quadraxas laugh Only one question, why its screen_size.y/2?
Posted By: bart_the_13th

Re: Splitscreen with different resolutions - 11/14/10 09:30

That depends on how do you want the screen splited?
If it's splitted horizontaly, it will be screen_size.x/2.
If it's splitted verticaly, then it will be screen_size.y/2
Posted By: 3run

Re: Splitscreen with different resolutions - 11/14/10 09:41

Yeah, it's splited horizontally (for FPS).
So I need to do like this:
Code:
camera.size_x = camera2.size_x = screen_size.x/2;
camera2.pos_x = screen_size.x/2;

Am I right?
Posted By: bart_the_13th

Re: Splitscreen with different resolutions - 11/14/10 10:18

Originally Posted By: 3run
Yeah, it's splited horizontally (for FPS).
So I need to do like this:
Code:
camera.size_x = camera2.size_x = screen_size.x/2;
camera2.pos_x = screen_size.x/2;

Am I right?

Well, basically yes. But your example in the first post show that you're using vertical split laugh
Posted By: 3run

Re: Splitscreen with different resolutions - 11/14/10 12:20

grin My mistake then, I thought that I was using horizontal one.
Does it mean, that I don't need to change views X size?
What about wide screen monitors? How can I make views adapt automatically?
Same as you said 'screen_size.x/2'?
© 2023 lite-C Forums