Hello!
I'm making a game using sfml + tgui, and for my level creator I need EditBoxes, so I made new tgui::Gui object for creator menu and loaded Widgets using loadWidgetsFromFile() function.
These Widget declarations in .txt file look like this:
then, when in main menu I click button directing me to creator I'm calling this function in a loop:
But with this code it doesn't work like it should, when I press any key loop manages to execute few times and I get a few characters instead of one, in addition, backspace doesn't work. I think I should change something in EditBok drawing, but I have run out of ideas, nothing seems to work so far. Could you give me some advice? I'm using TGUI 0.8. Thanks in advance
I'm making a game using sfml + tgui, and for my level creator I need EditBoxes, so I made new tgui::Gui object for creator menu and loaded Widgets using loadWidgetsFromFile() function.
These Widget declarations in .txt file look like this:
Code (cpp) Select
EditBox.width {
Position = (10, 40);
DefaultText = "Number of cols...";
}
then, when in main menu I click button directing me to creator I'm calling this function in a loop:
Code (cpp) Select
void Menu::showEdit(sf::Event & event)
{
if (event.type == sf::Event::Closed)
window.close();
window.clear(sf::Color::White); // clear window with white color
editGui.handleEvent(event);
editGui.draw(); // drawing loaded widgets
window.display();
}
But with this code it doesn't work like it should, when I press any key loop manages to execute few times and I get a few characters instead of one, in addition, backspace doesn't work. I think I should change something in EditBok drawing, but I have run out of ideas, nothing seems to work so far. Could you give me some advice? I'm using TGUI 0.8. Thanks in advance