Ejemplo n.º 1
0
static void vita2d_font_render_msg(void *data, const char *msg,
      const void *userdata)
{
   float x, y, scale;
   unsigned color;
   settings_t *settings = config_get_ptr();
   vita_font_t *vita = (vita_font_t *)data;
   const struct font_params *params = (const struct font_params*)userdata;

   (void)data;

   if (params)
   {
      x     = params->x;
      y     = params->y;
      scale = params->scale;
      color = params->color;
   }
   else
   {
      x     = settings->video.msg_pos_x;
      y     = 0.90f;
      scale = 0.8f;
      color = YELLOW;
   }
   
   vita2d_font_draw_text(vita->font, x, y, color, vita->size*scale, msg);      
}
Ejemplo n.º 2
0
inline int PutChar(PspFont *font, int sx, int sy, unsigned char sym, int color)
{
  if(!font->font){
    font->font=vita2d_load_font_mem(stockfont,stockfont_size);
    font->Height=pspFontGetLineHeight(font);
    font->Ascent=font->Height;
  }
  /* Instead of a tab, skip 4 spaces */
  if (sym == (uint8_t)'\t')
    return pspFontGetTextWidth(font," ") * 4;

  /* This function should be rewritten to write directly to VRAM, probably */
  char buf[2];
  buf[0]=sym;
  buf[1]='\0';
  int w = vita2d_font_draw_text(font->font,sx+1,sy+1,PSP_COLOR_BLACK,PSP_FONT_SIZE,buf);
  w = vita2d_font_draw_text(font->font,sx,sy,color,PSP_FONT_SIZE,buf);
  return w;
}
Ejemplo n.º 3
0
void GUILabel::Render()
{
//	debugNetPrintf(DEBUG, "rendering label %i %i %i %s\n", screen_pos.x, screen_pos.y, font_size, text);
	vita2d_font_draw_text(font, screen_pos.x, screen_pos.y, color, font_size, text);
}