Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - angdrw

Pages: [1]
1
Window / Re: Draw fps with window.draw
« on: March 11, 2016, 09:06:27 pm »
Thank you fixed the problem :)

2
Window / Draw fps with window.draw
« on: March 11, 2016, 08:53:25 pm »
Hey i come up to a problem and i have no idea how to fix it, The problem is that i want to draw fps on the screen and it does so. But it seems that i does that multiple times . I think i have to reset the text.setString, It look like this:

http://postimg.org/image/jg2f2zxm7/

My code:
    ostringstream ss;
    sf::Text text;

    text.setFont(font);
    text.setCharacterSize(15);
    text.setColor(sf::Color::Red);
    text.setStyle(sf::Text::Bold);
    text.setPosition(0,0);

//inside gameloop

//window.clear()

ss << "FPS: " << fps;
text.setString(ss.str())
window.draw(text);

//window.display()

Pages: [1]
anything