| 7 | namespace GUI |
| 8 | { |
| 9 | Imaged_Button::Imaged_Button(const std::string& imageFileName, const std::string& text, |
| 10 | std::function<void(void)>function) |
| 11 | : m_function (function) |
| 12 | { |
| 13 | m_quad.setSize({BASE_WIDTH, BASE_HEIGHT}); |
| 14 | m_quad.setTexture(&Component::guiTexture); |
| 15 | m_quad.setOutlineColor(sf::Color::Black); |
| 16 | m_quad.setOutlineThickness(2); |
| 17 | |
| 18 | initText(m_text, 40, text); |
| 19 | |
| 20 | m_image.loadFromFile(imageFileName + ".png"); |
| 21 | m_imageRect.setSize({144, 144}); |
| 22 | m_imageRect.setTexture(&m_image); |
| 23 | m_imageRect.setOutlineColor(sf::Color::Black); |
| 24 | m_imageRect.setOutlineThickness(2); |
| 25 | |
| 26 | } |
| 27 | |
| 28 | void Imaged_Button::input(const sf::Event& e) |
| 29 | { |
nothing calls this directly
no test coverage detected