SFMLmultigameButton::SFMLmultigameButton(const sf::Vector2<int> &pos, const std::string &gameName, const std::string &desc, const std::string &nbPlayer) { databaseSFML *db = databaseSFML::getDatabase(); this->_background.setTexture(db->getTexture("multigameButton")); _text = SFMLbasicText(gameName, pos, 20); _desc = SFMLbasicText(desc, pos, 12); _nbPlayers = SFMLbasicText(nbPlayer, pos, 12); this->setPosition(sf::Rect<int>(pos.x, pos.y, 300, 50)); this->_funcFocus = std::bind(&SFMLmultigameButton::hover, this, this); this->_funcUnfocus = std::bind(&SFMLmultigameButton::unhover, this, this); this->_funcRelease = std::bind(&SFMLmultigameButton::click, this, this); }
SFMLcharacterInput::SFMLcharacterInput(const sf::Vector2<int> &pos, keysOpt keyAssigned, const std::string &val) { this->_key = keyAssigned; this->_maxMessage = 1; this->_message = SFMLbasicText(val, pos); this->_area = sf::Rect<int>(pos.x, pos.y, 30, 30); InitInputLabel(); }
SFMLbuttonLauncher::SFMLbuttonLauncher(const sf::Vector2<int> &pos, const std::string &txt) { databaseSFML *db = databaseSFML::getDatabase(); this->_background.setTexture(db->getTexture("popupButtonBackground")); this->_background.setPosition((float)pos.x, (float)pos.y); this->_area = sf::Rect<int>(pos.x, pos.y, (int)_background.getLocalBounds().width, (int)_background.getLocalBounds().height); this->_text = SFMLbasicText(txt, sf::Vector2<int>(0, 0), 20); this->_text.setColor(sf::Color(166, 166, 166, 255)); this->InitButton(); this->_funcFocus = std::bind(&SFMLbuttonLauncher::hoverFunc, this, this); this->_funcUnfocus = std::bind(&SFMLbuttonLauncher::unhoverFunc, this, this); }