Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
painttext.h File Reference
#include <string>
#include "guidefs.h"
#include "font.h"

Go to the source code of this file.

Classes

class  PaintText
 
struct  PaintText::TextFragment
 
struct  PaintText::TextLine
 
struct  PaintText::LayoutState
 

Functions

std::string colorsToCommandString (float r, float g, float b, float a=1.0)
 

Function Documentation

std::string colorsToCommandString ( float  r,
float  g,
float  b,
float  a = 1.0 
)

Definition at line 747 of file painttext.cpp.

Referenced by factionColorTextString(), and BaseComputer::showPlayerInfo().

748 {
749  char buf[256];
750  if (a >= 1.0)
751  //Three-color string.
752  sprintf( buf, "#c%.3g:%.3g:%.3g#", r, g, b );
753  else
754  //Four-color string.
755  sprintf( buf, "#c%.3g:%.3g:%.3g:%.3g#", r, g, b, a );
756  return buf;
757 }