Advertisement
Pieman7373

Typewriter routine

Jul 26th, 2021
1,095
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.67 KB | None | 0 0
  1. void typewrite_routine(unsigned int cursor_x, uint8_t cursor_y,const char *input,unsigned int delay,uint8_t FGColor,uint8_t BGColor){
  2.  
  3.     unsigned int x = 0;
  4.     unsigned int y = 0;
  5.     unsigned int virtual_cursor = 0;
  6.     unsigned int length = strlen(input);
  7.     char scroll_string[] = "0";
  8.    
  9.     fontlib_SetColors(FGColor,BGColor);
  10.     fontlib_SetCursorPosition(cursor_x,cursor_y);
  11.     //fontlib_SetTransparency(transparent);
  12.    
  13.     for(virtual_cursor=0;virtual_cursor<length;virtual_cursor++){
  14.        
  15.         scroll_string[0] = input[virtual_cursor];
  16.        
  17.         gfx_BlitScreen();
  18.         fontlib_DrawString(scroll_string);
  19.         gfx_SwapDraw();
  20.        
  21.         for(x=0;x==delay;x++){
  22.             for(y=0;y==delay;y++){};
  23.         };
  24.     }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement