void CreditsWnd::DrawCredits(GG::X x1, GG::Y y1, GG::X x2, GG::Y y2, int transparency) { GG::Flags<GG::TextFormat> format = GG::FORMAT_CENTER | GG::FORMAT_TOP; //offset starts with 0, credits are place by transforming the viewport GG::Y offset(0); //start color is white (name), this color is valid outside the rgba tags glColor(GG::Clr(transparency, transparency, transparency, 255)); std::string credit; for (int i = 0; i < m_credits.NumChildren(); i++) { if (0 == m_credits.Child(i).Tag().compare("GROUP")) { XMLElement group = m_credits.Child(i); for (int j = 0; j < group.NumChildren(); j++) { if (0 == group.Child(j).Tag().compare("PERSON")) { XMLElement person = group.Child(j); credit = ""; if (person.ContainsAttribute("name")) credit += person.Attribute("name"); if (person.ContainsAttribute("nick") && person.Attribute("nick").length() > 0) { credit += " <rgba 153 153 153 " + boost::lexical_cast<std::string>(transparency) +">("; credit += person.Attribute("nick"); credit += ")</rgba>"; } if (person.ContainsAttribute("task") && person.Attribute("task").length() > 0) { credit += " - <rgba 204 204 204 " + boost::lexical_cast<std::string>(transparency) +">"; credit += person.Attribute("task"); credit += "</rgba>"; } m_font->RenderText(GG::Pt(x1, y1+offset), GG::Pt(x2, y2), credit, format, 0); offset += m_font->TextExtent(credit, format).y + 2; } } offset += m_font->Lineskip() + 2; } } //store complete height for self destruction m_creditsHeight = Value(offset); }