I don't know if this is a glitch in the engine or in the script, but I want to place a button at coordinates (0,0) on the screen and set it to be invisible. But, not only does it show up anyway, the button's initial background color "bleeds" into the main background panel for some odd reason.
My level_loader.wdl:
Code:
var video_mode= 8;
var video_screen= 1;
var video_depth= 32;
include "level_loader_top.wdl";
include "level_loader_car.wdl";
string level1_wmb= <carmovesnd.wmb>;
string level2_wmb= <top_move_test.wmb>;
bmap back_pcx= "mrcode.pcx";
bmap mouse_pcx= "cursor.pcx";
function main()
{
mouse_map= mouse_pcx;
mouse_mode= 2;
while(1)
{
mouse_pos.x= pointer.x;
mouse_pos.y= pointer.y;
wait(1);
}
}
panel back_pan
{
pos_x= 0;
pos_y= 0;
bmap= back_pcx;
flags= visible;
}
panel button1_pan
{
button= (384,250,"topspinner_on.pcx","top_spinner.pcx","topspinner_ovr.pcx",load_lvl1,null,null);
layer= 2;
flags= visible;
}
panel button2_pan
{
button= (350,350,"car3d_on.pcx","car_3d.pcx","car3d_ovr.pcx",load_lvl2,null,null);
layer= 2;
flags= visible;
}
panel exit_pan
{
button (290,450,"exit_on.pcx","exit_off.pcx","exit_ovr.pcx",exit,null,null);
layer= 2;
flags= visible;
}
panel back_button
{
button= (0,0,"back_on.pcx","back.pcx","back_ovr.pcx",null,null,null);
layer= 3;
flags= visible;
}
function load_lvl1()
{
wait(1);
mouse_mode= 0;
wait(1);
button1_pan.visible= off;
wait(1);
button2_pan.visible= off;
wait(1);
exit_pan.visible= off;
wait(1);
back_pan.visible= off;
wait(2);
level_load (level2_wmb);
wait(1);
camera.x= 0;
camera.y= -876;
camera.z= 664;
camera.pan= 90;
camera.tilt= -62;
camera.roll= 0;
}
function load_lvl2()
{
wait(1);
mouse_mode= 0;
wait(1);
button2_pan.visible= off;
wait(1);
button1_pan.visible= off;
wait(1);
exit_pan.visible= off;
wait(1);
back_pan.visible= off;
wait(2);
level_load (level1_wmb);
wait(2);
camera.x= -714;
camera.y= 0;
camera.z= 845;
camera.pan= 360;
camera.tilt= -71;
camera.roll= 0;
}
function exit()
{
while(1)
{
sys_exit(null);
wait(1);
}
}
And the images showing the error:
Without back button code:

With back button code:

Please excuse the tiny images, Imageshack does ridiculous things to your pictures. Still, at least you can see the difference.