#include "rSDL.h"
#include "defs.h"
#include "tString.h"
#include "tColor.h"
#include <map>
Go to the source code of this file.
Classes | |
class | rTextField |
Defines | |
#define | rCWIDTH_NORMAL (16/640.0) |
#define | rCHEIGHT_NORMAL (32/480.0) |
Enumerations | |
enum | sr_fontClass { sr_fontConsole = 00001, sr_fontMenu = 00002, sr_fontMenuTitle = 00004, sr_fontScoretable = 00010, sr_fontMenuHelp = 00020, sr_fontError = 00040, sr_fontCockpit = 00100, sr_fontCenterMessage = 00200, sr_fontServerBrowser = 00400, sr_fontCycleLabel = 01000, sr_fontServerDetails = 02000 } |
Different types of fonts, they might get different font files assigned. More... | |
enum | sr_fontTypes { sr_fontOld = 0, sr_fontPixmap = 1, sr_fontBitmap = 2, sr_fontTexture = 3, sr_fontPolygon = 4, sr_fontOutline = 5, sr_fontExtruded = 6 } |
Different ways to render fonts. More... | |
Functions | |
template<class T> | |
rTextField & | operator<< (rTextField &c, const T &x) |
void | DisplayText (REAL x, REAL y, REAL h, const char *text, sr_fontClass type, int center=0, int cursor=0, int cursorPos=0, rTextField::ColorMode colorMode=rTextField::COLOR_USE) |
void | sr_ReloadFont (void) |
Reloads the font (in case the resolution or font type changes). | |
Variables | |
int | sr_fontType |
#define rCHEIGHT_NORMAL (32/480.0) |
enum sr_fontClass |
Different types of fonts, they might get different font files assigned.
Definition at line 41 of file rFont.h.
00041 { 00042 sr_fontConsole = 00001, 00043 sr_fontMenu = 00002, 00044 sr_fontMenuTitle = 00004, 00045 sr_fontScoretable = 00010, 00046 sr_fontMenuHelp = 00020, 00047 sr_fontError = 00040, 00048 sr_fontCockpit = 00100, 00049 sr_fontCenterMessage = 00200, 00050 sr_fontServerBrowser = 00400, 00051 sr_fontCycleLabel = 01000, 00052 sr_fontServerDetails = 02000 00053 };
enum sr_fontTypes |
Different ways to render fonts.
Definition at line 56 of file rFont.h.
00056 { 00057 sr_fontOld = 0, 00058 sr_fontPixmap = 1, 00059 sr_fontBitmap = 2, 00060 sr_fontTexture = 3, 00061 sr_fontPolygon = 4, 00062 sr_fontOutline = 5, 00063 sr_fontExtruded = 6 00064 };
void DisplayText | ( | REAL | x, | |
REAL | y, | |||
REAL | h, | |||
const char * | text, | |||
sr_fontClass | type, | |||
int | center = 0 , |
|||
int | cursor = 0 , |
|||
int | cursorPos = 0 , |
|||
rTextField::ColorMode | colorMode = rTextField::COLOR_USE | |||
) |
Definition at line 718 of file rFont.cpp.
References c, rTextField::GetTextLength(), height, REAL, rTextField::SetCursor(), rTextField::SetIndent(), rTextField::SetWidth(), rTextField::StringOutput(), and rTextField::width.
Referenced by rViewportConfiguration::DemonstrateViewport(), uMenu::Message(), uMenu::OnEnter(), eTeam::RankingGraph(), uMenuItemInput::Render(), gServerMenu::Render(), rConsole::Render(), cWidget::VerticalBarGauge::RenderCaption(), cWidget::BarGauge::RenderCaption(), cWidget::NeedleGauge::RenderGraph(), cWidget::VerticalBarGauge::RenderGraph(), cWidget::BarGauge::RenderGraph(), cWidget::BarGauge::RenderMinMax(), gCycle::RenderName(), and welcome().
00718 { 00719 #ifndef DEDICATED 00720 float height; 00721 float width = rTextField::GetTextLength(tString(text), h, true, true, &height); 00722 00723 // shrink fields that don't fit the screen 00724 REAL maxw = 1.95 - x; 00725 if ( width > maxw ) 00726 { 00727 h *= maxw/(width); 00728 width=maxw; 00729 } 00730 00731 rTextField c(x-(center+1)*width*.5,y+h*.5,h,type); 00732 if (center==-1) 00733 c.SetWidth(1.-x); 00734 else 00735 c.SetWidth(10000); 00736 00737 c.SetIndent(5); 00738 if (cursor) 00739 c.SetCursor(cursor,cursorPos); 00740 c.StringOutput(text, colorMode ); 00741 #endif 00742 }
rTextField& operator<< | ( | rTextField & | c, | |
const T & | x | |||
) | [inline] |
Definition at line 185 of file rFont.h.
References rTextField::StringOutput().
00185 { 00186 tColoredString out; 00187 out << x; 00188 return c.StringOutput(out); 00189 }
void sr_ReloadFont | ( | void | ) |
Reloads the font (in case the resolution or font type changes).
Definition at line 359 of file rFont.cpp.
References rFontContainer::clear().
int sr_fontType |