I was not including TGUI.hpp! I only had "#include <TGUI/Widgets/EditBox.hpp>". Now it works, thank you!
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 void StartScreenController::constructJoinScreen() {
auto gui = std::make_shared<tgui::Gui>(*this->_window);
int win_x = this->_window->getSize().x;
int win_y = this->_window->getSize().y;
// Edit boxes
auto editBox = tgui::EditBox::create();
editBox->setSize(200, 25);
editBox->setTextSize(18);
editBox->setPosition(win_x/2-300, win_y/2);
editBox->setDefaultText("Enter host IP address...");
// This line of code below causes an error when uncommented.
// editBox->connect("ReturnKeyPressed", &StartScreenController::handleEnterHostIpAddress, this);
gui->add(editBox);
this->_join_screen = ss::Screen(this->_window, gui, "../resources/images/main_bg.png");
}
void StartScreenController::handleEnterHostIpAddress(const sf::String& buttonText) {
std::cout << "enter host ip game" << std::endl;
}
undefined reference to `unsigned int tgui::SignalWidgetBase::connect<void (ss::StartScreenController::*)(sf::String const&), ss::StartScreenController*>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void (ss::StartScreenController::*&&)(sf::String const&), ss::StartScreenController* const&)'