Advertisement
CaptainLepidus

showMessage

Jun 4th, 2012
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.     while( 1 )
  3.     {
  4.         xs = view_xview + 150;//X start
  5.         ys = view_yview + 150;//Y start
  6.         xe = view_xview + view_wview - 150;//X end
  7.         ye = view_yview + view_hview - 150;//Y end
  8.         bxs = view_xview + view_wview - 200;//Button x start
  9.         bys = view_yview + view_hview - 180;//Button y start
  10.         bxe = bxs + 40;//Button x end
  11.         bye = bys + 20;//Button y end
  12.         col[ 0 ] = c_blue;//Background
  13.         col[ 1 ] = c_white;//Outline & Content
  14.         col[ 2 ] = c_yellow;//Hover
  15.         bt = 'Close';//Button text
  16.         if ( keyboard_check( vk_space ) == true || keyboard_check( vk_enter ) == true || keyboard_check( vk_escape ) == true || ( mouse_check_button( mb_left ) and mouse_x >= bxs and mouse_y >= bys and mouse_x <= bxe and mouse_y <= bye ) )
  17.         {
  18.             io_clear();
  19.             exit;
  20.         }
  21.         screen_refresh();
  22.         draw_set_color( col[ 0 ] );
  23.         draw_rectangle( xs , ys , xe , ye , 0 );
  24.         draw_set_color( col[ 1 ] );
  25.         draw_rectangle( xs , ys , xe , ye , 1 );
  26.         draw_set_halign( fa_left );
  27.         draw_set_valign( fa_top );
  28.         draw_text( xs + 2 , ys + 2 , argument0 );
  29.         if ( mouse_x >= bxs and mouse_y >= bys and mouse_x <= bxe and mouse_y <= bye )
  30.         {
  31.             draw_set_color( c_yellow );
  32.         }
  33.         draw_rectangle( bxs , bys , bxe , bye , 1 );
  34.         draw_set_halign( fa_middle );
  35.         draw_set_valign( fa_center );
  36.         draw_text( mean( bxs , bxe ) , mean( bys , bye ) , bt );
  37.         io_handle();
  38.         sleep( 1000 / 60 );
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement