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

Author Topic: Text not drawing  (Read 2338 times)

0 Members and 1 Guest are viewing this topic.

Christopher Jozwiak

  • Newbie
  • *
  • Posts: 48
    • View Profile
    • Blog
    • Email
Text not drawing
« on: July 01, 2016, 03:10:43 am »
I can't figure out why my text won't display to my window.  I reference mWindow with each function.  Anyways the codes in multiple files so I uploaded it to a repository on GitHub. https://github.com/Sianide4000/Swaric-Game-Engine
Noob C++ Programmer.

Gambit

  • Sr. Member
  • ****
  • Posts: 283
    • View Profile
Re: Text not drawing
« Reply #1 on: July 01, 2016, 04:37:21 am »
Firstly I would like to point out that the repo you have linked has absolutely nothing useful to us in it. Where is the rest of your code?

Secondly, http://sscce.org/.

Christopher Jozwiak

  • Newbie
  • *
  • Posts: 48
    • View Profile
    • Blog
    • Email
Re: Text not drawing
« Reply #2 on: July 01, 2016, 06:08:44 pm »
Thanks for the info I will start using those guidelines for posting code.  I didn't upload all the files.  Could of swore I did, but I didn't check.  I think I know what the problem is.  If not I'll post all of the code for more assistance.
Noob C++ Programmer.

Christopher Jozwiak

  • Newbie
  • *
  • Posts: 48
    • View Profile
    • Blog
    • Email
Re: Text not drawing
« Reply #3 on: July 01, 2016, 08:41:50 pm »
Alright, still having the problem.

Here is the portion that won't work.
gameManager.cpp
while(mWindow.isOpen()){
    mWindow.clear(sf::Color::Black);
    lManager.onMenu(mWindow);

    mWindow.draw(lManager.Exit);
    wManager.windowDisplay(mWindow);
    eManager.eventLoop(mWindow);
    }
levelManager.cpp
void levelManager::onMenu(sf::RenderWindow &mWindow){
    stateManager sManager;
    loadFonts();
    setText();
    posManager();
    int state = sManager.getState();
    if (state == 1){
        mWindow.draw(Start);
        mWindow.draw(Exit);
        std::cout << "OnMenu";
    }
I've made sure the state interger is initialized to 0 and "OnMenu" but no text is displayed to the window. Everything runs though without error.  The font is loaded as well.
Noob C++ Programmer.

Christopher Jozwiak

  • Newbie
  • *
  • Posts: 48
    • View Profile
    • Blog
    • Email
Re: Text not drawing
« Reply #4 on: July 02, 2016, 12:37:46 am »
Disregard. I repeat, disregard.  I got to ahead of myself.  I started creating a ton of classes at the beginning of the project.  Instead of testing to see if every class was functional I was throwing code in each file to get them all to work together.  Building a new engine.  Much better to think things out before throwing code in a file.  ::)
Noob C++ Programmer.

 

anything