Beispiel #1
0
int log_setup_1(){
	//Load Font
	if( PTSANS_loaded == false ){
		if (!PTSANS.LoadFromFile("PTN57F.ttf", 50)) return -1;
		PTSANS_loaded = true;
	}

	//Setup Strings
	log_string.SetFont( PTSANS );
	log_string.SetSize(24.f);
	log_string.SetColor( sf::Color(255, 255, 255) );
	log_string.SetPosition(100.f, 600.f);

	log_name.SetFont( PTSANS );
	log_name.SetSize(40.f);
	log_name.SetColor( sf::Color(255, 255, 255) );
	log_name.SetPosition(100.f, 550.f);
}
Beispiel #2
0
 Button(int x, int y, int w, int h,
        const std::string & text,
        const sf::Font & font,
        WidgetContainer * parent = NULL)
 : Widget(x, y, w, h, parent)
 {
     m_renderText.SetFont(font);
     setText(text);
     m_action = NULL;
 }
Beispiel #3
0
 TextBar(int x, int y, int w, int h,
         const sf::Font & font,
         GenericAction * enterAction = NULL,
         WidgetContainer * parent = NULL)
     : Widget(x, y, w, h, parent)
 {
     m_renderText.SetFont(font);
     setText("");
     m_enterAction = enterAction;
 }
Beispiel #4
0
    void    InfoBox::draw(sf::RenderWindow& rw)
    {
        glColor3f(0.6, 0.6, 0.6);
        drawRectangle(start_, end_, true);

        static sf::String tx;
        tx.SetText("Status");
        tx.SetFont(sf::Font::GetDefaultFont());
        tx.SetStyle(sf::String::Bold);
        tx.SetPosition(start_[0] + 20, start_[1] + 20);
        tx.SetSize(16);
        rw.Draw(tx);
    }
Beispiel #5
0
void FontFunctions::InitString(sf::String& str, const int size)
{
	str.SetFont(FontFunctions::_font);
	str.SetColor(sf::Color::Black);
	str.SetSize(size);
}