Guest User

Untitled

a guest
Jan 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. typedef struct GRRLIB_TexButton{
  2. int x;
  3. int y;
  4. int w;
  5. int h;
  6. u32 color;
  7. GRRLIB_ttfFont *GRRLIBfont;
  8. GRRLIB_texImg *tex_GRRLIBbutton;
  9. void Button_Init(int cx, int cy, int cw, int ch, u32 ccolor) {
  10. GRRLIBfont = GRRLIB_LoadTTF(FreeMonoBold_ttf, FreeMonoBold_ttf_size);
  11. x=cx;
  12. y=cy;
  13. w=cw;
  14. h=ch;
  15. color=ccolor;
  16. tex_GRRLIBbutton = GRRLIB_LoadTexture(GRRLIBbutton);
  17. GRRLIB_InitTileSet(tex_GRRLIBbutton, 4,24, 0);
  18. }
  19. void Button_Show(){
  20. guVector bg[] = {{x+4,y,0},{x+4+w,y,0},{x+4+w,y+h,0},{x+4,y+h,0}};
  21. GRRLIB_DrawTile(x, y, tex_GRRLIBbutton , 0, 1, 1, col,0 );
  22. GRRLIB_DrawTileQuad(bg, tex_GRRLIBbutton, col, 1);
  23. GRRLIB_DrawTile(bg[1].x, bg[1].y, tex_GRRLIBbutton , 0, 1, 1, col,2);
  24. }
  25.  
  26. } GRRLIB_TexButton;
Add Comment
Please, Sign In to add comment