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 - Silverdagger

Pages: [1]
1
Graphics / Re: Weird Issue while trying to show text
« on: February 17, 2017, 09:39:30 am »
Good new i found the problem - i did not have proper knowledge of the std::vector and was using it the wrong way hence the problem. But its fixed now .

2
Graphics / Re: Weird Issue while trying to show text
« on: February 17, 2017, 12:11:07 am »
Sorry i am new at this. If i run it via VS i get a breakpoint, if i realeashe and run the window just closes on me without any messege. The code here if you want to test.. https://www.dropbox.com/sh/b0o7ku05i8jbr2d/AADDODDgvdb-d8koi_GqC0mla?dl=0

3
Graphics / Weird Issue while trying to show text
« on: February 16, 2017, 11:45:22 pm »
Hello, i am not decent at C++ but the following should work (but it doesn't)

//1 Doesnt work
sf::Text* ptxt = &dt->getElement(0);
std::cout << ptxt->getCharacterSize(); //size is printed correctly
ptxt->setCharacterSize(30);
std::cout << ptxt->getCharacterSize(); //size is changed correctly
ptxt->setString("No Sir");
window.draw(*ptxt); //Error

//2 Works
//sf::Text txt = dt->getElement(0);
//txt.setString("No sir");
//window.draw(txt);

//3 Works
//window.draw(dt->getElement(0));
 


I have a class that stores text on a vector and i fetch it in main for testing.
Although the example in the learning section of SFML works , parts 2 and 3 of the code work on their own - if i attempt to use the 1st part i get an error on the draw at runtime.

Pages: [1]
anything