Guest User

loading

a guest
Jan 14th, 2020
68
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void afiseazaLoadingBar(int x1,int y1,int x2,int y2)
  2. {
  3. setfillstyle(SOLID_FILL,BLACK);
  4. bar(x1,y1,x2,y2);
  5. }
  6.  
  7. void setLoadingBarStatus(int x1,int y1,int x2,int y2,int status)
  8. {
  9. setfillstyle(SOLID_FILL,COLOR(129,114,114));
  10. bar(x1+1,y1+1,x2+status,y2-1);
  11. }
  12.  
  13. void afiseazaMesajStatus(int status,int x,int y)
  14. {
  15. status = (200+status+1)/2;
  16.  
  17. char sir[10]= {0};
  18.  
  19. if(status < 10)
  20. {
  21. sir[0]=status+'0';
  22. sir[1]='%';
  23. }
  24. else if(status < 100)
  25. {
  26. sir[0]=status/10+'0';
  27. sir[1]=status%10+'0';
  28. sir[2]='%';
  29. }
  30. else
  31. {
  32. sir[0]='1';
  33. sir[2]='0';
  34. sir[3]='0';
  35. sir[4]='%';
  36. }
  37.  
  38. settextstyle(SIMPLEX_FONT, HORIZ_DIR, 1);
  39. settextjustify(CENTER_TEXT, CENTER_TEXT);
  40. setbkcolor(COLOR(93,172,228));
  41. outtextxy(x,y,sir);
  42. }
  43.  
  44. void afiseazaStatus(int status)
  45. {
  46.  
  47. afiseazaLoadingBar(300,275,500,325);
  48.  
  49. setLoadingBarStatus(300,275,500,325,status);
  50.  
  51. afiseazaMesajStatus(status,400,250);
  52.  
  53. delay(20);
  54. }
  55.  
  56. void loadingScreen()
  57. {
  58. cleardevice();
  59. setbkcolor(COLOR(93,172,228));
  60. cleardevice();
  61.  
  62. buton titlu;
  63.  
  64. initializeazaTitlu(titlu,"Loading...",400,200);
  65.  
  66. for(int i=-200; i<0; i+=2)
  67. afiseazaStatus(i);
  68.  
  69. delay(100);
  70. }
RAW Paste Data