Resources::Resources() { MenuBG = Iw2DCreateImage("textures/menu_bkg.jpg"); PlayButton = Iw2DCreateImage("textures/play.png"); // Load fonts settingsButtonImage = Iw2DCreateImage("textures/settings-button.png"); Font = Iw2DCreateFont("fonts/arial8.gxfont"); }
CIw2DFont* FontManager::getFont(string sFontName) { IW_CALLSTACK("FontManager::getFont"); CIw2DFont* iTmpFont = tiFontLibrary.get(sFontName); if(iTmpFont == NULL) //add the indicated Font file to the library if it's not already there { iTmpFont = Iw2DCreateFont((sFontName + ".gxfont").c_str()); if(iTmpFont == NULL) { IwAssertMsg(MYAPP, false, ("getFont could not find Font file %s", sFontName.c_str())); return NULL; } pair<string, CIw2DFont*>newPair = pair<string, CIw2DFont*>(sFontName, iTmpFont); tiFontLibrary.insert(newPair); return iTmpFont; } return iTmpFont; }