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

Author Topic: Not sure what I am doing wrong with SF::String()?  (Read 1906 times)

0 Members and 1 Guest are viewing this topic.

Halfwarr

  • Newbie
  • *
  • Posts: 2
    • View Profile
Not sure what I am doing wrong with SF::String()?
« 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.




Any ideas would be appreciated?

Halfwarr

  • Newbie
  • *
  • Posts: 2
    • View Profile
Not sure what I am doing wrong with SF::String()?
« Reply #1 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.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Not sure what I am doing wrong with SF::String()?
« Reply #2 on: April 21, 2009, 06:18:18 pm »
Don't use function Clear ?
SFML / OS X developer

 

anything