____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
A futuristic real-time strategy game.
This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project.
Distributed under the "GNU General Public License"
#include <string>
#include "SDL.h"
#include "guichan/font.h"
Go to the source code of this file.
Classes | |
| class | CFont |
| Font definition. More... | |
| class | CFontColor |
Defines | |
| #define | MaxFontColors 9 |
| Font color definition. | |
| #define | FontRed "red" |
| #define | FontGreen "green" |
| #define | FontYellow "yellow" |
| #define | FontWhite "white" |
| #define | FontGrey "grey" |
Functions | |
| void | SetDefaultTextColors (const std::string &normal, const std::string &reverse) |
| < Set the default text colors for normal and reverse text | |
| void | GetDefaultTextColors (std::string &normalp, std::string &reversep) |
| Draw text unclipped. | |
| int | VideoDrawText (int x, int y, CFont *font, const std::string &text) |
| Draw text unclipped. | |
| int | VideoDrawTextClip (int x, int y, CFont *font, const std::string &text) |
| Draw reverse text unclipped. | |
| int | VideoDrawReverseText (int x, int y, CFont *font, const std::string &text) |
| Draw reverse text clipped. | |
| int | VideoDrawReverseTextClip (int x, int y, CFont *font, const std::string &text) |
| Draw text centered and unclipped. | |
| int | VideoDrawTextCentered (int x, int y, CFont *font, const std::string &text) |
| Draw number unclipped. | |
| int | VideoDrawNumber (int x, int y, CFont *font, int number) |
| Draw number clipped. | |
| int | VideoDrawNumberClip (int x, int y, CFont *font, int number) |
| Draw reverse number unclipped. | |
| int | VideoDrawReverseNumber (int x, int y, CFont *font, int number) |
| Draw reverse number clipped. | |
| int | VideoDrawReverseNumberClip (int x, int y, CFont *font, int number) |
| Get the hot key from a string. | |
| int | GetHotKey (const std::string &text) |
| Load and initialize the fonts. | |
| void | LoadFonts () |
| Free OpenGL fonts. | |
| void | FreeOpenGLFonts () |
| Reload OpenGL fonts. | |
| void | ReloadFonts () |
| Cleanup the font module. | |
| void | CleanFonts () |
Variables | |
| CFont * | SmallFont |
| Small font used in stats. | |
| CFont * | GameFont |
| Normal font used in game. | |
| CFont * | LargeFont |
| Large font used in menus. | |
Definition in file include/font.h.
| #define FontGreen "green" |
| #define FontGrey "grey" |
Definition at line 125 of file include/font.h.
| #define FontRed "red" |
FIXME: should be moved to lua
Definition at line 121 of file include/font.h.
Referenced by DrawInfoPanelNoneSelected().
| #define FontWhite "white" |
Definition at line 124 of file include/font.h.
Referenced by LoadGame(), main1(), and PreMenuSetup().
| #define FontYellow "yellow" |
Definition at line 123 of file include/font.h.
Referenced by LoadGame(), main1(), and PreMenuSetup().
| #define MaxFontColors 9 |
Font color definition.
Definition at line 99 of file include/font.h.
Referenced by MakeFontColorTextures(), tolua_get_stratagus_CFontColor_Colors(), tolua_set_stratagus_CFontColor_Colors(), tolua_stratagus_open(), and VideoDrawChar().
| void CleanFonts | ( | void | ) |
Clean up the font module.
Definition at line 902 of file font.cpp.
References AllFontColors, AllFonts, FontColorGraphics, FontColors, Fonts, int(), CGraphic::NumTextures, CGraphic::Textures, and UseOpenGL.
Referenced by CleanModules().
| void FreeOpenGLFonts | ( | ) |
Reload OpenGL fonts.
Free OpenGL fonts
Definition at line 774 of file font.cpp.
References AllFontColors, AllFonts, FontColorGraphics, CFont::G, int(), CGraphic::NumTextures, and CGraphic::Textures.
Referenced by CVideo::ResizeScreen().
| void GetDefaultTextColors | ( | std::string & | normalp, | |
| std::string & | reversep | |||
| ) |
Draw text unclipped.
Get the default text colors.
| normalp | Normal text color pointer. | |
| reversep | Reverse text color pointer. |
Definition at line 161 of file font.cpp.
References DefaultNormalColorIndex, and DefaultReverseColorIndex.
Referenced by DrawInfoPanelNoneSelected(), DrawMenuButton(), DrawPopup(), StartEditor(), and StartMap().
| int GetHotKey | ( | const std::string & | text | ) |
Load and initialize the fonts.
Get the hot key from a string
Definition at line 264 of file font.cpp.
References convertKey(), and GetUTF8().
Referenced by AddButton(), and ButtonWidget::ButtonWidget().
| void LoadFonts | ( | ) |
Free OpenGL fonts.
Load all fonts.
Definition at line 750 of file font.cpp.
References AllFonts, CGraphic::File, CFont::G, CFont::Get(), int(), CGraphic::Load(), MakeFontColorTextures(), ShowLoadProgress(), and UseOpenGL.
Referenced by LoadGame(), LoadModules(), main1(), and PreMenuSetup().
| void ReloadFonts | ( | void | ) |
Cleanup the font module.
Reload OpenGL fonts
Definition at line 790 of file font.cpp.
References AllFontColors, AllFonts, FontColorGraphics, CFont::G, int(), MakeFontColorTextures(), and CGraphic::Textures.
Referenced by ReloadOpenGL().
| void SetDefaultTextColors | ( | const std::string & | normal, | |
| const std::string & | reverse | |||
| ) |
< Set the default text colors for normal and reverse text
Get the default text colors for normal and reverse text
Set the default text colors.
| normal | Normal text color. | |
| reverse | Reverse text color. |
Definition at line 147 of file font.cpp.
References DefaultNormalColorIndex, DefaultReverseColorIndex, and CFontColor::Get().
Referenced by CreateGame(), DrawInfoPanelNoneSelected(), DrawMenuButton(), DrawPopup(), LoadGame(), LoadModules(), main1(), PreMenuSetup(), StartEditor(), and StartMap().
| int VideoDrawNumber | ( | int | x, | |
| int | y, | |||
| CFont * | font, | |||
| int | number | |||
| ) |
Draw number clipped.
Draw number with font at x,y unclipped.
| x | X screen position | |
| y | Y screen position | |
| font | Font number | |
| number | Number to be displayed. |
Definition at line 601 of file font.cpp.
References FormatNumber(), int(), and VideoDrawText().
Referenced by DrawCosts(), DrawInfoPanelNoneSelected(), and DrawPopup().
| int VideoDrawNumberClip | ( | int | x, | |
| int | y, | |||
| CFont * | font, | |||
| int | number | |||
| ) |
Draw reverse number unclipped.
Draw number with font at x,y clipped.
| x | X screen position | |
| y | Y screen position | |
| font | Font number | |
| number | Number to be displayed. |
Definition at line 619 of file font.cpp.
References FormatNumber(), int(), and VideoDrawTextClip().
Referenced by DrawDecoration(), and Missile::DrawMissile().
| int VideoDrawReverseNumber | ( | int | x, | |
| int | y, | |||
| CFont * | font, | |||
| int | number | |||
| ) |
Draw reverse number clipped.
Draw reverse number with font at x,y unclipped.
| x | X screen position | |
| y | Y screen position | |
| font | Font number | |
| number | Number to be displayed. |
Definition at line 637 of file font.cpp.
References FormatNumber(), int(), and VideoDrawReverseText().
| int VideoDrawReverseNumberClip | ( | int | x, | |
| int | y, | |||
| CFont * | font, | |||
| int | number | |||
| ) |
Get the hot key from a string.
Draw reverse number with font at x,y clipped.
| x | X screen position | |
| y | Y screen position | |
| font | Font number | |
| number | Number to be displayed. |
Definition at line 655 of file font.cpp.
References FormatNumber(), int(), and VideoDrawReverseTextClip().
| int VideoDrawReverseText | ( | int | x, | |
| int | y, | |||
| CFont * | font, | |||
| const std::string & | text | |||
| ) |
Draw reverse text clipped.
Draw reverse text with font at x,y unclipped.
| x | X screen position | |
| y | Y screen position | |
| font | Font number | |
| text | Text to be displayed. |
Definition at line 511 of file font.cpp.
References VideoDrawText().
Referenced by VideoDrawReverseNumber().
| int VideoDrawReverseTextClip | ( | int | x, | |
| int | y, | |||
| CFont * | font, | |||
| const std::string & | text | |||
| ) |
Draw text centered and unclipped.
Draw reverse text with font at x,y clipped.
| x | X screen position | |
| y | Y screen position | |
| font | Font number | |
| text | Text to be displayed. |
Definition at line 534 of file font.cpp.
References VideoDrawTextClip().
Referenced by VideoDrawReverseNumberClip().
| int VideoDrawText | ( | int | x, | |
| int | y, | |||
| CFont * | font, | |||
| const std::string & | text | |||
| ) |
Draw text unclipped.
Draw text with font at x,y unclipped.
| x | X screen position | |
| y | Y screen position | |
| font | Font number | |
| text | Text to be displayed. |
Definition at line 477 of file font.cpp.
References DoDrawText().
Referenced by DrawInfoPanelMultipleSelected(), DrawInfoPanelNoneSelected(), DrawMenuButton(), DrawPlayers(), DrawPopup(), DrawResources(), DrawTimer(), DrawTrainingUnits(), DrawUnitStats(), ShowTitleImage(), VideoDrawNumber(), VideoDrawReverseText(), and VideoDrawTextCentered().
| int VideoDrawTextCentered | ( | int | x, | |
| int | y, | |||
| CFont * | font, | |||
| const std::string & | text | |||
| ) |
Draw number unclipped.
Draw text with font at x,y centered.
| x | X screen position | |
| y | Y screen position | |
| font | Font number | |
| text | Text to be displayed. |
Definition at line 557 of file font.cpp.
References VideoDrawText(), and CFont::Width().
Referenced by DrawCoordinates(), DrawMenuButton(), DrawPlayers(), DrawTrainingUnits(), DrawUnitInfo(), DrawUnitStats(), and ShowLoadProgress().
| int VideoDrawTextClip | ( | int | x, | |
| int | y, | |||
| CFont * | font, | |||
| const std::string & | text | |||
| ) |
Draw reverse text unclipped.
Draw text with font at x,y clipped.
| x | X screen position | |
| y | Y screen position | |
| font | Font number | |
| text | Text to be displayed. |
Definition at line 494 of file font.cpp.
References DoDrawText().
Referenced by CStatusLine::Draw(), DrawInformations(), MessagesDisplay::DrawMessages(), DrawPieMenu(), CFont::drawString(), VideoDrawNumberClip(), and VideoDrawReverseTextClip().
Normal font used in game.
Definition at line 77 of file font.cpp.
Referenced by DrawCoordinates(), DrawCosts(), DrawDecoration(), DrawInfoPanelNoneSelected(), Missile::DrawMissile(), DrawPieMenu(), DrawPlayers(), DrawResources(), DrawUnitInfo(), DrawUnitStats(), and ShowLoadProgress().
Small font used in stats.
Font selector for the font functions. FIXME: should be moved to lua
Definition at line 76 of file font.cpp.
Referenced by DrawPlayers(), DrawPopup(), and DrawUnitInfo().
1.5.6