button = x, y, bmapOn, bmapOff, bmapOver, functionOn, functionOff, functionOver;

Defines a button, which can be clicked on and triggers a function.

Parameters:

x x position relative to the upper left edge of the panel
y y position relative to the upper left edge of the panel
bmapOn bitmap displayed when the button is clicked on; gives also the size of the button
bmapOff bitmap displayed when the mouse is not over the button
bmapOver bitmap displayed when the mouse is over the button
functionOn function executed if the mouse is clicked over the button
functionOff function executed if the mouse is released over the button or leaves the button
functionOver function executed if the mouse touches the button

Remarks:

Example:

function count_up_skill(button_number,panel)
{
  snd_play(click,50,0);
  if (button_number == 1) { player.SKILL40 += 1; }
  if (button_number == 2) { player.SKILL41 += 1; }
  if (button_number == 3) { player.SKILL42 += 1; }
}


panel skill_pan 			
{
  button = 0,0,on_map,off_map,off_map,count_up_skill,NULL,NULL;
  button = 0,10,on_map,off_map,off_map,count_up_skill,NULL,NULL;
  button = 0,20,on_map,off_map,off_map,count_up_skill,NULL,NULL;
}

See also:

panel, bmap, layer, pos_x, pos_y, alpha, flags, vslider, hslider, window, digits, mouse_map, on_click