Hi
If JUCE 7 to draw gradient text, you could do something like the following, but in JUCE 8 this isn’t working. Is there another approach?
void MenuBar::paint(Graphics& g) {
g.fillAll(Colours::grey);
auto gradient = juce::ColourGradient::horizontal(c1, 0, c2, w);
g.setGradientFill(gradient);
g.drawText(name, 0, 0, w, h, Justification::left);
}
thanks
peter
Ok not to worry, I switched to use a GlyphArrangement that works and is probably the favoured method?
e.g.
void MenuBar::paint(Graphics& g) {
glyphs.addFittedText(font, name, 0, 0, w, h, Justification::left, 2, 1.0f);
Path p;
glyphs.createPath(p);
auto gradient = juce::ColourGradient::horizontal(c1, 0, c2, w);
g.setGradientFill(gradient);
g.fillPath(p, getTransform());
}
reuk
3
Thanks for reporting this issue. The original example you posted should be fixed by this patch, which is now available on the develop branch.