Advertisement
Guest User

allos

a guest
Dec 20th, 2011
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.42 KB | None | 0 0
  1. void mouse() {
  2.     int my_pic_y =- 2 - (mapa[1][0][m_tam - 1] * 5); p_y = m_tam - 1;
  3.     int na_area_central = 0;
  4.     mostramenu = 1;
  5.  
  6.     ALLEGRO_BITMAP *area_central = 0;
  7.  
  8.     area_central = al_create_bitmap(18, 18);
  9.     if (ev.type == ALLEGRO_EVENT_MOUSE_AXES) {
  10.         if (ev.mouse.x >= 656 - al_get_bitmap_width(area_central) / 2 &&
  11.             ev.mouse.x <= 656 + al_get_bitmap_width(area_central) / 2 &&
  12.             ev.mouse.y >= 90 - al_get_bitmap_height(area_central) / 2 &&
  13.             ev.mouse.y <= 90 + al_get_bitmap_height(area_central) / 2)
  14.  
  15.          {
  16.              na_area_central = 1;
  17.          }
  18.          else
  19.          {
  20.              na_area_central = 0;
  21.          }
  22.     }
  23.     else if (ev.type == ALLEGRO_EVENT_MOUSE_BUTTON_DOWN) {
  24.  
  25.     }
  26.     al_set_target_bitmap(area_central);
  27.     if (!na_area_central) {
  28.         al_clear_to_color(al_map_rgb(255, 255, 255));
  29.     }
  30.     else
  31.     {
  32.         al_clear_to_color(al_map_rgb(0, 255, 0));
  33.     }
  34.     al_set_target_bitmap(al_get_backbuffer(display));
  35.     al_draw_bitmap(area_central, 656 - al_get_bitmap_width(area_central) / 2,
  36.     90 - al_get_bitmap_height(area_central) / 2, 0);
  37.  
  38.  
  39.     if (mostramenu == 1) {
  40.         if (mapa[0][p_x][p_y] == 1) {
  41.             al_draw_bitmap(tile, 680, 82, 0);
  42.         }
  43.         else if (mapa[0][p_x][p_y] == 2) {
  44.             al_draw_bitmap(tile2, 680, 82, 0);
  45.         }
  46.     }
  47.     al_destroy_bitmap(area_central);
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement