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

Author Topic: sf::Text Same variable for many uses ? How to unload ?  (Read 1609 times)

0 Members and 1 Guest are viewing this topic.

OutlawLee

  • Jr. Member
  • **
  • Posts: 50
  • This is my personal text. Dont read it.
    • View Profile
    • Email
sf::Text Same variable for many uses ? How to unload ?
« on: May 08, 2012, 05:10:20 pm »
So at the beginning i made sf::Text and set the string to example1. Then i changed the position and the string to example2. But when i do App.Display() i get both. Do i have to make a new sf::Text, or can i somehow unload the example1.

Does making a new variable impact my code in the long run ? (if i continue making new sf::Text for every text)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: sf::Text Same variable for many uses ? How to unload ?
« Reply #1 on: May 08, 2012, 06:54:51 pm »
setString overwrites the previous value. If you get both, then you must be doing something wrong, please show your code.
Laurent Gomila - SFML developer

OutlawLee

  • Jr. Member
  • **
  • Posts: 50
  • This is my personal text. Dont read it.
    • View Profile
    • Email
Re: sf::Text Same variable for many uses ? How to unload ?
« Reply #2 on: May 08, 2012, 10:16:13 pm »
Thanks for pointing the fact that it overwrites. I rewritten my code from scratch and now it seems to be working alright. I think it was a problem that i made some declarations inside a class that should be inside   ;D