Hi guys, i'm trying to create a simple menu, that's the code.
Code:
panel main_pan
{
layer = 1;
pos_x = 0;
pos_y = 0;
button = 300, 550, exit, exit, exit, null, null, null;
button = 300, 515, options, options, options, null, null, null;
button = 300, 480, newgame, newgame, newgame, null, null, null;
flags = overlay, refresh, visible;
}
panel selection1_pan
{
layer = 1;
bmap = selection_tga;
pos_x = 300;
pos_y = 480;
flags = overlay, refresh, visible;
}
panel selection2_pan
{
layer = 1;
bmap = selection_tga;
pos_x = 300;
pos_y = 512;
flags = overlay, refresh, visible;
}
panel selection3_pan
{
layer = 1;
bmap = selection_tga;
pos_x = 300;
pos_y = 550;
flags = overlay, refresh, visible;
}
fuction selection()
{
if(select == 0){
selection1_pan.visible = on;
selection2_pan.visible = off;
selection3_pan.visible = off;
}
if(select == 1){
selection1_pan.visible = off;
selection2_pan.visible = on;
selection3_pan.visible = off;
}
}
function main()
{
fps_max = 50;
level_load (intro_wmb);
sleep (5);
time_smooth = 0.9;
}
if(key_cuu == on && select >= 0){
select += 1;
}
if(key_cud == on && select <= 2){
select -= 1;
}
selection();
}
The compiler tell me there is an error, why this code isn't good?
Someone have an example of a keyword menu or there is as aum?
Thx all for the answer.