MCPcopy Create free account
hub / github.com/Hopson97/HopsonCraft / Imaged_Button

Method Imaged_Button

Source/GUI/Imaged_Button.cpp:9–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7namespace 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 {

Callers

nothing calls this directly

Calls 1

loadFromFileMethod · 0.45

Tested by

no test coverage detected