Guest User

Untitled

a guest
Feb 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. #include "template.h"
  2. #include "surface.h"
  3. #include "game.h"
  4. #include "icecat.h"
  5.  
  6. using namespace Tmpl8;
  7.  
  8. Sprite Title(new Surface("assets/title.jpg"), 1);
  9. Sprite TextF(new Surface("assets/fontset.png"), 96);
  10.  
  11. void Game::Text(char string[512], int x, int y)
  12. {
  13.     int _ptx=x;
  14.     int _pty=y;
  15.     AddEntry(string, "text", 1);
  16.     for (int i=0; i<=512; i++)
  17.     {
  18.         last[i]=(int)string[i];
  19.         if (last[i]==94) break;
  20.         if (last[i]==126) {last[i]=1; _pty+=FH; _ptx=x-FW;}
  21.         if (last[i]>0) last[i]-=32;
  22.         if (last[i]<0 || last[i]>96) last[i]=0;
  23.         TextF.SetFrame( last[i] );
  24.         TextF.Draw(_ptx,_pty,m_Screen);
  25.         _ptx+=FW;
  26.         if (_ptx>=SCRWIDTH-FW-x) {_ptx=x; _pty+=FH;}
  27.         if (i==512) { break; }
  28.     }
  29. }
  30.  
  31. void Game::Menu()
  32. {
  33.     //visuals
  34.         Title.Draw(0,0,m_Screen);
  35.         Text("                 Press Enter^",5,320);
  36.         Text("     Created by Sam H. (110157) / icecat^",5,455);
  37.  
  38.     //action
  39.     if (Game::_pause==false)
  40.     {
  41.        
  42.     }
  43. }
Add Comment
Please, Sign In to add comment