Advertisement
Rauthag

char

Oct 14th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. class Character : public GraphElement
  2. {
  3. public:
  4. // position of character
  5. Point2D pos;
  6. // character
  7. char character;
  8.  
  9. Character( Point2D t_pos, char t_char, RGB t_fg, RGB t_bg ) :
  10. pos( t_pos ), character( t_char ), GraphElement( t_fg, t_bg ) {};
  11.  
  12. void draw()
  13. {
  14. int x = this->pos.x;
  15. int y = this-> pos.y;
  16. char ch = this->character;
  17. int Px=0;
  18. int Py=0;
  19.  
  20. for(int y=0;y<26;y++){
  21. int riadok=font[ch][y];
  22. for(int x=0;x<16;x++){
  23. if(riadok & 1<<x){
  24. drawPixel((Px+16)-x,Py+y);
  25. }
  26. }
  27.  
  28. }
  29. }
  30. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement