Sometime crashes, sometimes blank text, and sometimes works.
I'm passing (I hope) a reference to TextDisplay::update() so It can draw all the text in keyBindMenu
which is a vector of std::strings. I'm not sure if I'm handling this correctly. My understanding of this is very weak, but I think I did it correctly (passing the ref)

int main(int argc, char** argv) {
   bool displayMenu = false;
   std::vector<std::string> keyBindMenu;
      keyBindMenu.push_back("Escape toggle this menu");
      keyBindMenu.push_back("W,A,S,D map view scroll");
      keyBindMenu.push_back("Up,Down,Left,Right keys select tile");
      keyBindMenu.push_back("+,- map zoom");
      keyBindMenu.push_back("Left Mouse button to place tile");

   sf::RenderWindow *pWindow;
   sf::RenderWindow displayWindow(sf::VideoMode(DWIN_WIDTH, DWIN_HEIGHT),
           "Map Editor");
   TextDisplay mainMenu(100, 100, 600, keyBindMenu.size()*45, displayWindow.getSize());

     ....

                       case sf::Keyboard::Escape:
                     if (displayMenu) displayMenu = false;
                     else displayMenu = true;
                     break;


      ....

      if (displayMenu) {
         mainMenu.update(pWindow, keyBindMenu);
      }

     // ****** code from TextDisplay class 
void TextDisplay::update(sf::RenderWindow *window, std::vector<std::string> &menuText) {

   // display a rect area that text will display
   window->draw(*pTextArea);

   for (int i = 0; i <= menuText.size(); i++) {
      text.setString(menuText[i]);
      text.setPosition(sf::Vector2f(textBox.left + 40, (textBox.top + 7)+
              (i * (font.getLineSpacing(MENU_TEXT_SIZE)))));
      window->draw(text);

   }
   //std::cout << "updating menu" << std::endl;
}

What compiler and operating system? Have you used your compiler's debugger to single step through the program so that you can see what's happening? You have not provided enough code to enable us to make any knowledgable comments. Attach the entire file(s) to your post so that we can test it.

the line below was the problem the <= to should have been <. fixed it when I made that change.

 for (int i = 0; i <= menuText.size(); i++) {
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.