const BitmapFont& FontLibrary::load_font(const std::string& font_name, const std::string& config_path) { auto it = loaded_fonts_.find(font_name); if (it != loaded_fonts_.end()) return it->second; auto insert_result = loaded_fonts_.insert(std::make_pair(font_name, BitmapFont(config_path))); return insert_result.first->second; }
//----------------------------------------------------------------------------------------------- inline void CommandConsole::Initialize() { GenerateConsolePaneVBO(); GenerateTextCursorVBO(); static const std::string fontDefinitionLocation = "Data/Font/MainFont_EN.FontDef.xml"; static const std::string fontImageLocation = "Data/Font/MainFont_EN_00.png"; m_font = BitmapFont( fontDefinitionLocation, &fontImageLocation, 1 ); }
//----------------------------------------------------------------------------------------------- void LoadDeveloperConsole() { g_consoleFont = BitmapFont( MAIN_FONT_GLYPH_SHEET_FILE_NAME, MAIN_FONT_META_DATA_FILE_NAME ); g_developerConsole = DeveloperConsole( Vector2( 0.f, (float) SCREEN_HEIGHT * 0.25f ), Vector2( (float) SCREEN_WIDTH, (float) SCREEN_HEIGHT ), g_consoleFont ); g_developerConsole.AddCommandFuncPtr( "clear", ConsoleFunctionClear ); g_developerConsole.AddCommandFuncPtr( "quit", ConsoleFunctionQuit ); g_developerConsole.AddCommandFuncPtr( "changeIP", ConsoleFunctionChangeIP ); g_developerConsole.AddCommandFuncPtr( "changePort", ConsoleFunctionChangePortNumber ); }