void frontcredits_draw(void) { struct CreditsItem *credit; TbBool did_draw; int fontid; long i; long h; const char *text; credits_offset -= credits_scroll_speed; frontend_copy_background(); lbDisplay.DrawFlags = Lb_SPRITE_OUTLINE | Lb_TEXT_HALIGN_CENTER; LbTextSetWindow(0, 0, lbDisplay.PhysicalScreenWidth, lbDisplay.PhysicalScreenHeight); fontid = 1; LbTextSetFont(frontend_font[fontid]); h = credits_offset; did_draw = h > 0; for (i = 0; campaign.credits[i].kind != CIK_None; i++) { if (h >= lbDisplay.PhysicalScreenHeight) break; credit = &campaign.credits[i]; if (credit->font != fontid) { fontid = credit->font; LbTextSetFont(frontend_font[fontid]); } int ln_height; ln_height = -LbTextLineHeight() * units_per_pixel / 16; if (h > ln_height) { switch (credit->kind) { case CIK_GStringId: text = gui_string(credit->num); break; case CIK_CStringId: text = cmpgn_string(credit->num); break; case CIK_DirectText: text = credit->str; break; default: text = ""; break; } LbTextDrawResized(0, h, units_per_pixel, text); did_draw = 1; } h += ln_height + 2 * units_per_pixel / 16; } if (!did_draw) { credits_end = 1; credits_offset = lbDisplay.PhysicalScreenHeight; } }
void frontstory_draw(void) { frontend_copy_background(); LbTextSetWindow(70*units_per_pixel/16, 70*units_per_pixel/16, (640-2*70)*units_per_pixel/16, (480-2*70)*units_per_pixel/16); LbTextSetFont(frontstory_font); lbDisplay.DrawFlags = Lb_TEXT_HALIGN_CENTER; int tx_units_per_px; tx_units_per_px = (26 * units_per_pixel) / LbTextLineHeight(); LbTextDrawResized(0, 0, tx_units_per_px, get_string(frontstory_text_no)); }
void frontbirthday_draw(void) { frontend_copy_background(); LbTextSetWindow(70, 70, 500, 340); LbTextSetFont(frontstory_font); lbDisplay.DrawFlags = Lb_SPRITE_OUTLINE; const char *name=get_team_birthday(); if ( name != NULL ) { unsigned short line_pos; line_pos = LbTextLineHeight(); LbTextDraw(0, 170-line_pos, get_string(GUIStr_HappyBirthday)); LbTextDraw(0, 170, name); } else { frontend_set_state(FeSt_INTRO); } }