SFML community forums

Help => Graphics => Topic started by: Halfwarr on April 21, 2009, 04:37:30 pm

Title: Not sure what I am doing wrong with SF::String()?
Post by: Halfwarr on April 21, 2009, 04:37:30 pm
I have a function that gets the players HPs and returns an int, so I convert that to a String and then output that, to String.SetText(String), and draw it everything seems fine but as soon as the Player's HPs change it leaves behind the text.

Not sure what I am doing wrong but here it is the code.

Code: [Select]

message = ("HP:" + intToString(m_jons->getCurrentHP()));
m_text->SetText(message);
m_app->Draw(*m_text);
m_app->Display();


now here is the weird thing that I just discovered if I minimize the window and bring it back the "ghosting" effect is cleared.

Here is a picture of what I am talking about.

(http://img523.imageshack.us/img523/6371/textq.jpg)


Any ideas would be appreciated?
Title: Not sure what I am doing wrong with SF::String()?
Post by: Halfwarr on April 21, 2009, 04:53:23 pm
ah I think I figured out what the problem was  :D  there was nothing in the background where I was loading the text, which apparently causes the ghosting effect to happen.
Title: Not sure what I am doing wrong with SF::String()?
Post by: Hiura on April 21, 2009, 06:18:18 pm
Don't use function Clear ?