hi! I’ve posted about this plugin before but didn’t have my client request this until now. the plugin is pretty simple. it’s a gain knob that goes from -100 decibels (basically complete silence) to +60 db.
the gui he requested is pretty simple but he wanted the textbox in the middle as well as a custom font. and colour for the text.
how would I go about doing this?
If you also need the label to be editable, that’s going to be a little more complex, as the hit-box of the slider & text-box would intersect. Which means, it’s unclear where mouse events should go. Slider::LookAndFeelMethods::getSliderLayout is the other functioon you should look at. It positions the slider & textbox.
likely you have to come up with your own combination of label and slider thingie cause the label that is part of slider by design can only be placed next to it but not on top. if you wanna have a cool knob you need to functionality to click on the label to enter a text value tho, so that’s why you can’t just draw it on the knob with look and feel, despite it looking the same on the surface
// create typeface pointer and store it somewhere
// probably as a member in your LookAndFeel
juce::Typeface::Ptr typeface = juce::Typeface::createSystemTypefaceFor(
BinaryData::MyFont_ttf,
BinaryData::MyFont_ttfSize
);
// in paint function
g.setFont(juce::Font{typeface}.withHeight(12.0F));
g.drawText(...);