MCPcopy Create free account
hub / github.com/AbyssEngine/AbyssEngineOld / Button

Method Button

src/Abyss/UI/Button.h:60–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58
59 public:
60 explicit Button(const ButtonDef &buttonDef, const std::string_view text, const Concepts::FontRenderer &fontRenderer, std::function<void()> onClick)
61 : _drawable(buttonDef.resourceName), _def(buttonDef), _state(ButtonState::Normal), _text(text), _label(fontRenderer), _onClick(std::move(onClick)),
62 _clickSound(std::make_unique<Streams::AudioStream>(Singletons::getFileProvider().loadFile(buttonDef.clickSound))) {
63 _drawable.setPalette(_def.palette);
64 _label.setText(_text);
65 }
66
67 auto draw(const int x, const int y) -> void {
68 handleMouse(x, y);

Callers

nothing calls this directly

Calls 3

setTextMethod · 0.80
loadFileMethod · 0.45
setPaletteMethod · 0.45

Tested by

no test coverage detected