this is just a different variation of orange_brat's code, so the copyright is to him.
This code is so that the position of your panels will change according to the screen resolution, instead of resizing your panels, it moves them like in other fps' and so on.
Code:
//code made by orange_brat, edited by manslayer101
panel* pnl;
bmap bmap_name = <bmap_file.bmp>;
panel panel_name
{
bmap = bmap_name;
layer = 1;
pos_x = 0;
pos_y = 0;
flags = overlay;
}
function resize()
{
if(video_mode == 6) //640x480
{
pnl = panel_name; //assign panel names as you go
pnl.pos_x += 0;
pnl.pos_y += 0;
return;
}
if(video_mode == 7) //800x600
{
pnl = panel_name; //assign panel names as you go
pnl.pos_x += 160;
pnl.pos_y += 120;
return;
}
if(video_mode == 8) //1024x768
{
pnl = panel_name; //assign panel names as you go
pnl.pos_x += 384;
pnl.pos_y += 228;
return;
}
if(video_mode == 9) //1280x1024
{
pnl = panel_name; //assign panel names as you go
pnl.pos_x += 640;
pnl.pos_y += 544;
return;
}
if(video_mode == 11) //1600x1200
{
pnl = panel_name; //assign panel names as you go
pnl.pos_x += 960;
pnl.pos_y += 720;
return;
}
}
this code is assuming that you used 640x480 in order to position your panels, if you didn't you will have to edit the code to suit what you did. if you used 800x600 instead of 640x480 you will have to change the positions like this:
Code:
if(video_mode == 6) //640x480
{
pnl = panel_name; //assign panel names as you go
pnl.pos_x -= 160;
pnl.pos_y -= 120;
return;
}
if(video_mode == 7) //800x600
{
pnl = panel_name; //assign panel names as you go
pnl.pos_x += 0;
pnl.pos_y += 0;
return;
}
Etc...
(no i will not completely rewrite the code)