Advertisement
Guest User

Untitled

a guest
Aug 18th, 2023
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.93 KB | None | 0 0
  1. void CLauncher::DrawAppDrawer()
  2. {
  3.     for(int i = 0; i < sizeof(Apps) / sizeof(CAppDesc*); i++)
  4.     {
  5.         int x = drawerAnimator->X + (i * 75);
  6.         int y = drawerAnimator->Y;
  7.         Graphics->DrawImage(Apps[i]->Icon, x, y);
  8.  
  9.         if(Input->IsTouchedAt(x, y, Apps[i]->Icon->Width, Apps[i]->Icon->Height))
  10.         {
  11.             StartScreen(new CDialerScreen());
  12.         }
  13.     }
  14. }
  15.  
  16. void CLauncher::StartScreen(CScreen* screen)
  17. {
  18.     if(screen)
  19.     {
  20.         currentScreen = screen;
  21.         currentScreen->Show();
  22.     }
  23. }
  24.  
  25. void CLauncher::Run()
  26. {
  27.     CImage* test = CImage::FromFile("ui/stFiller.tga");;
  28.  
  29.     while(true)
  30.     {
  31.         Input->Update();
  32.  
  33.         Graphics->DrawImage(Wallpaper, 0, 0);
  34.  
  35.         if(currentScreen)
  36.         {
  37.             currentScreen->Update();   
  38.             currentScreen->Draw();
  39.         }
  40.         else
  41.         {
  42.             drawerAnimator->Update();
  43.             DrawAppDrawer();
  44.         }
  45.  
  46.         Status->Update();
  47.         Status->Draw();
  48.                
  49.                 if(Dialog->IsVisible())
  50.              Dialog->Draw();
  51.  
  52.         Graphics->Flip();
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement