--FIXED--
ok, in my program i have a class known as gText (game text)
my header file has the sf::Text and sf::String,
now the class just simply stores a string and the object has a method which allows access to the sf::Text to be drawn, i split this up so i could have one class deal with anything that is related to text.
now in my gState (game state) it has a vector of gText so i can push as many as i like on to the vector (stack) and all of them will be read from a for loop and will be drawn to the screen.
But the problem i have with a global gText called tmpText is if i use that push it onto the vector of gText then push another tmpText again but with a different string, the first gText in the vector will not display the correct string that was stored. so if i then remove the global tmpText and create a instance of gText when i want to use it like so
gText tmpText;
tmpPos.x = 325; tmpPos.y = -5;
tmpText.setUpText(tmpPos,"Phor",font);
tmpText.textDisplay.setColor(sf::Color(82,47,12));
tmpText.textDisplay.setCharacterSize(150);
texts.push_back(tmpText);
it will push that onto the stack, but once it my program goes down the main loop, it will then check the size of the vector of gText, it will find that there is one to be drawn, but when it actually goes to try and draw it, it breaks my program and gives the error (access memory violiation), so with a global i cant push more than one gText onto my vector of gText and if i create a instance of gtext then push it on to the vector, i get access violiation... I dont know how I can get around this
its ok, what i do is i populate my vector first, so if i want two strings on screen i would just do a simple
texts.push_back(tmpText);
texts.push_back(tmpText);
then from that i can just use the vector.at() method. cheers for the help but i got it now
if i have anymore problems i will let you know