You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
492B

  1. #if!defined FOURTEENSEGMENTDISPLAY_HPP
  2. #define FOURTEENSEGMENTDISPLAY_HPP
  3. #include <rack.hpp>
  4. class TextDisplay : public rack::Widget
  5. {
  6. public:
  7. explicit TextDisplay();
  8. void setText(std::string const& text);
  9. void setFontSize(float const size);
  10. void draw(NVGcontext* vg) override;
  11. private:
  12. std::shared_ptr<rack::Font> const m_font;
  13. std::string m_displayedText;
  14. float m_fontSize = 20.f;
  15. NVGcolor m_onColor = nvgRGB(0, 0x0, 0);
  16. NVGcolor m_offColor = nvgRGB(0xFF, 0x0, 0x0);
  17. };
  18. #endif