Hi guys!
I’ve been searching for hours and tried to make it myself but no luck :/. I have no idea how to implement this. I am getting started lately on GUI development on JUCE for VSTs (I am a graphic designer and the team just needs GUI design help for the VST).
Say I made a component called “myHeader.cpp” (for the header of the VST), this one has a few rectangles inside made with DrawRectangle declared in the “myHeader.h” file. I managed to position them and color them all nicely. Now question is, how do I go about adding any imageEffectsFilter (like shadow, blur, glow) that is available inside JUCE? I am mainly focused on GlowEffect. Here is the header file .h:
class myHeader : public Component
{
public:
myHeader();
~myHeader();
void paint (Graphics&) override;
void resized() override;
private:
Colour headerColor;
Colour masterVol_AddinstColor;
Colour bgFieldColor;
myPatchField patchField;
DrawableRectangle logoRect;
DrawableRectangle patchRect;
DrawableRectangle masterVolRect;
DrawableRectangle addInstRect;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (myHeader)
}; **class** myHeader : **public** Component
{
**public** :
myHeader();
~myHeader();
**void** paint (Graphics&) **override** ;
**void** resized() **override** ;
**private** :
Colour headerColor;
Colour masterVol_AddinstColor;
Colour bgFieldColor;
myPatchField patchField;
DrawableRectangle logoRect;
DrawableRectangle patchRect;
DrawableRectangle masterVolRect;
DrawableRectangle addInstRect;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (myHeader)
};
And this is my paint method in the .cpp file, the constructor has only the addAndMakeVisible function in it:
void myHeader::paint (Graphics& g)
{
g.fillAll (Colour::fromRGBA(51, 51, 51, 0));
Image myImage (Image::RGB, 500, 500, true);
GlowEffect ds;
ds.applyEffect(myImage, g, 1.0f, 0.5);
logoRect.setFill(headerColor);
patchRect.setFill(headerColor);
masterVolRect.setFill(masterVol_AddinstColor);
addInstRect.setFill(masterVol_AddinstColor);
}
Plz help :’(, also is DrawRectangle a good way to insert different backgrounds for different sections of the VST?
Thank you so much in advance for the help i am struggling with this for quite some time now :/.
Any example or a bit more detailed explanation would be amazing.