Main Menu
Menu

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.

Show posts Menu

Messages - Flaze07

#1
General Discussion / Re: 2 tgui::Gui
11 July 2017, 18:55:46
ahh thank you
#2
General Discussion / Re: 2 tgui::Gui
11 July 2017, 18:49:30
also do you prefer

tgui::Gui gui{app_win};

or

tgui::Gui gui(app_win);

?
#3
General Discussion / Re: 2 tgui::Gui
11 July 2017, 18:47:59
haha silly me,
forgot to initialize them with the sf::RenderWindow...
now I look like a total idiot
#4
General Discussion / Re: 2 tgui::Gui
11 July 2017, 18:42:01
I decided to make it like this
before

menu->add(button1, "button1");

after

menu->add(button1);


and now...the problem is in menu.handleEvent(event)
and somehow there's problem in...let me attach an image
#5
General Discussion / 2 tgui::Gui
11 July 2017, 18:33:05
hi...is it allowed to have more than one tgui::Gui

if it is allowed...I wonder why menu.draw makes my program crash

here's part of the code

while (app_win.isOpen())
    {
        sf::Event event;

        if (condition == Condition::start)
        {
            while (app_win.pollEvent(event))
            {
                if (event.type == sf::Event::Closed) app_win.close();
                menu.handleEvent(event);
            }

            app_win.clear();
            menu.draw();
            app_win.display();
        }
        else if (condition == Condition::single)
        {
            sf::Time elapsed = clock.restart();
            snake1.update(elapsed);
            snake1.action();
            snake1.check_apple(apple);
            if (snake1.collision(app_win))
            {
                condition = Condition::over;
            }

            app_win.clear();
            app_win.draw(apple.getShape());
            for (auto& a : snake1.getSnake())
            {
                app_win.draw(a);
            }
            app_win.display();
        }
        else if (condition == Condition::multi)
        {
            sf::Time elapsed = clock.restart();
            snake1.update(elapsed);
            snake1.action();
            snake1.check_apple(apple);
            if (snake1.check_snake(snake2))
            {
                condition = Condition::over;
            }
            if (snake1.collision(app_win))
            {
                condition = Condition::over;
            }
            snake2.update(elapsed);
            snake2.action();
            snake2.check_apple(apple);
            if (snake2.check_snake(snake1))
            {
                condition = Condition::over;
            }
            if (snake2.collision(app_win))
            {
                condition = Condition::over;
            }
            app_win.clear();
            app_win.draw(apple.getShape());
            for (auto& a : snake1.getSnake())
            {
                app_win.draw(a);
            }
            for (auto& a : snake2.getSnake())
            {
                app_win.draw(a);
            }
            app_win.display();
        }
        else if (condition == Condition::over)
        {
            while (app_win.pollEvent(event))
            {
                if (event.type == sf::Event::Closed) app_win.close();
                over.handleEvent(event);
            }

            if (oldcon == Condition::multi);
            app_win.clear();
            over.draw();
            app_win.display();
        }


full code is here https://gist.github.com/Flaze07/f008e65c0c85bcf44f0c46037447f7b5
#6
General Discussion / Re: .dll
10 July 2017, 12:56:45
nvm forget what I said about the string
also...the reason I put them in bin folder in tgui folder in codeblock folder is because that's how I use sfml and sfgui
#7
General Discussion / Re: .dll
10 July 2017, 12:47:45
also why is the signal result (checked or unchecked ) is in string style ??

(I've heard that it is close to CSS-style (never learnt CSS tho) )
#8
General Discussion / Re: .dll
10 July 2017, 12:45:57
ah I see...


well in the end I moved them to bin folder
#9
General Discussion / .dll
10 July 2017, 12:24:47
hi so...I just want to ask something ::)
why is the .dll in lib folder ??



and here's a question that's unrelated to tgui
why is it that
lazarus's forum, codeblock forum, sfml forum, this forum are all....similiar