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

Method Dropdown

Source/GUI/Dropdown.cpp:7–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5namespace GUI
6{
7 Dropdown::Dropdown(int& optionPtr,
8 const std::string& label,
9 const std::vector<std::string>& options)
10 : m_optionPtr (&optionPtr)
11 {
12 *m_optionPtr = 0;
13 initText(m_label, 10, label);
14
15 m_quad.setSize({70, 40});
16 m_quad.setTexture(&Component::guiTexture);
17 m_quad.setOutlineColor(sf::Color::Black);
18 m_quad.setOutlineThickness(2);
19
20 for (auto& option : options)
21 {
22 m_options.emplace_back(initText(15, option));
23 }
24 }
25
26 void Dropdown::input(const sf::Event& e)
27 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected