void DisplayTopBar(int ypos, int ttexcol, int backcol, char *title, char*texx, ...) { strcpy(topBar.text, get_translation(title)); char displbuf[3001]; va_list ap; va_start(ap,texx); my_sprintf(displbuf, get_translation(texx), ap); va_end(ap); if (ypos > 0) play.top_bar_ypos = ypos; if (ttexcol > 0) play.top_bar_textcolor = ttexcol; if (backcol > 0) play.top_bar_backcolor = backcol; topBar.wantIt = 1; topBar.font = FONT_NORMAL; topBar.height = wgetfontheight(topBar.font); topBar.height += multiply_up_coordinate(play.top_bar_borderwidth) * 2 + get_fixed_pixel_size(1); // they want to customize the font if (play.top_bar_font >= 0) topBar.font = play.top_bar_font; // DisplaySpeech normally sets this up, but since we're not going via it... if (play.cant_skip_speech & SKIP_AUTOTIMER) play.messagetime = GetTextDisplayTime(texx); DisplayAtY(play.top_bar_ypos, displbuf); }
void IAGSEngine::DrawTextWrapped (int32 xx, int32 yy, int32 wid, int32 font, int32 color, const char*text) { int texthit = wgetfontheight(font); break_up_text_into_lines (wid, font, (char*)text); wtextcolor(color); wtexttransparent(TEXTFG); multiply_up_coordinates(&xx, &yy); for (int i = 0; i < numlines; i++) draw_and_invalidate_text(xx, yy + texthit*i, font, lines[i]); }
int GetTextHeight(char *text, int fontnum, int width) { VALIDATE_STRING(text); if ((fontnum < 0) || (fontnum >= game.numfonts)) quit("!GetTextHeight: invalid font number."); int texthit = wgetfontheight(fontnum); break_up_text_into_lines(multiply_up_coordinate(width), fontnum, text); return divide_down_coordinate(texthit * numlines); }