void QuitConfirmMenu::Draw() { DrawTexturedRect(BACKGROUND, 0.0f, 0.0f, APP.GetScreenWidth(), APP.GetScreenHeight()); DrawRect(ColourRGBA(0.0f, 0.0f, 0.0f, 0.5f), 0.0f, TITLE_STARTY - ITEM_SPACING, APP.GetScreenWidth(), APP.GetScreenHeight() - TITLE_STARTY + ITEM_SPACING); FONTS.Print(FONT, m_titleOrigin.GetX(), m_titleOrigin.GetY(), TITLE_HEIGHT, ColourRGBA::White(), Font::ALIGN_CENTER, "RSI Already?"); // Draw the menu items MenuScreen::Draw(); }
void MainMenu::Draw() { DrawTexturedRect(BACKGROUND, 0.0f, 0.0f, APP.GetScreenWidth(), APP.GetScreenHeight()); DrawRect(ColourRGBA(0.0f, 0.0f, 0.0f, 0.5f), 0.0f, ITEM_STARTY - ITEM_SPACING, APP.GetScreenWidth(), APP.GetScreenHeight() - ITEM_STARTY + ITEM_SPACING); // Draw the version number FONTS.Print(VERSION_FONT, APP.GetScreenWidth(), APP.GetScreenHeight() - 12.0f, 12.0f, ColourRGBA::White(), Font::ALIGN_RIGHT, (boost::format("v%1%.%2% - %3%") % App::MAJOR_VERSION % App::MINOR_VERSION % __DATE__).str()); // Draw the menu items MenuScreen::Draw(); }
void OpenGL_DebugFont::RenderText( Gwen::Font* pFont, Gwen::Point pos, const Gwen::UnicodeString& text ) { float fSize = pFont->size * Scale(); if ( !text.length() ) return; Gwen::String converted_string = Gwen::Utility::UnicodeToString( text ); float yOffset=0.0f; for ( int i=0; i<text.length(); i++ ) { wchar_t chr = text[i]; char ch = converted_string[i]; float curSpacing = sGwenDebugFontSpacing[ch] * m_fLetterSpacing * fSize * m_fFontScale[0]; Gwen::Rect r( pos.x + yOffset, pos.y-fSize*0.2f, (fSize * m_fFontScale[0]), fSize * m_fFontScale[1] ); if ( m_pFontTexture ) { float uv_texcoords[8]={0.,0.,1.,1.}; if ( ch >= 0 ) { float cx= (ch%16)/16.0; float cy= (ch/16)/16.0; uv_texcoords[0] = cx; uv_texcoords[1] = cy; uv_texcoords[4] = float(cx+1.0f/16.0f); uv_texcoords[5] = float(cy+1.0f/16.0f); } DrawTexturedRect( m_pFontTexture, r, uv_texcoords[0], uv_texcoords[5], uv_texcoords[4], uv_texcoords[1] ); yOffset+=curSpacing; } else { DrawFilledRect( r ); yOffset+=curSpacing; } } }