PANEL* pLoadBar = { layer = 9999; }
function on_level_event(percent)
{
set(pLoadBar,SHOW | LIGHT); // switch load bar on
vec_set(pLoadBar.blue,vector(255,200,200));
pLoadBar.pos_x = 50;
pLoadBar.pos_y = 50;
pLoadBar.size_x = 10 + 3 * percent; // 10..310 pixels
pLoadBar.size_y = 10;
if (percent >= 100) { // level loading finished wait(-1.0); // display the load bar for one further second
reset(pLoadBar,SHOW); // switch it off
}
}