SFML community forums

Help => Window => Topic started by: Chris Jozwiak on July 01, 2016, 03:10:43 am

Title: Text not drawing
Post by: Chris Jozwiak 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 (https://github.com/Sianide4000/Swaric-Game-Engine)
Title: Re: Text not drawing
Post by: Gambit 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/.
Title: Re: Text not drawing
Post by: Chris Jozwiak 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.
Title: Re: Text not drawing
Post by: Chris Jozwiak 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.
Title: Re: Text not drawing
Post by: Chris Jozwiak 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.  ::)