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

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.


Messages - GaelSav

Pages: [1]
1
General / Re: TGUI & SFML - "pressed" event
« on: July 31, 2017, 09:49:38 am »
Ok will try to post there then. Cheers

2
General / TGUI & SFML - "pressed" event
« on: July 30, 2017, 07:43:55 pm »
Hi guys,

I've been using TGUI and SFML since few months on a little game quizz I developped.

There's an issue I am not able to solve regarding the "pressed" event.

When the game starts, a first window appears where the user needs to input its username and click OK. Then the quizz starts. However, when I run the code, if the user clicks OK, nothing happens. I figured out that the user has to click AND to move the mouse so that the event is correctly triggered.

Here is the code responsible for creating the OK button and the associated connect function:

// Create the "Ok" button
tgui::Button::Ptr button = theme->load("Button");
button->setSize(windowWidth / 2, windowHeight / 6);
button->setPosition(windowWidth / 4, windowHeight * 7 / 10);
button->setText("Ok");
gui.add(button);

// Call the login function when the button is pressed
button->connect("pressed", login, editBoxUsername);

Any help on this one?  :-[

Pages: [1]