JUCE  v5.1.1-3-g1a0b28c73
JUCE API
GlowEffect Class Reference

A component effect that adds a coloured blur around the component's contents. More...

#include <juce_GlowEffect.h>

Inheritance diagram for GlowEffect:
Collaboration diagram for GlowEffect:

Public Member Functions

 GlowEffect ()
 Creates a default 'glow' effect. More...
 
 ~GlowEffect ()
 Destructor. More...
 
void applyEffect (Image &, Graphics &, float scaleFactor, float alpha) override
 
void setGlowProperties (float newRadius, Colour newColour, Point< int > offset={})
 Sets the glow's radius and colour. More...
 

Private Attributes

Colour colour { Colours::white }
 
Point< intoffset
 
float radius = 2.0f
 

Detailed Description

A component effect that adds a coloured blur around the component's contents.

(This will only work on non-opaque components).

See also
Component::setComponentEffect, DropShadowEffect

Constructor & Destructor Documentation

◆ GlowEffect()

GlowEffect::GlowEffect ( )

Creates a default 'glow' effect.

To customise its appearance, use the setGlowProperties() method.

◆ ~GlowEffect()

GlowEffect::~GlowEffect ( )

Destructor.

Member Function Documentation

◆ applyEffect()

void GlowEffect::applyEffect ( Image ,
Graphics ,
float  scaleFactor,
float  alpha 
)
overridevirtual

Implements ImageEffectFilter.

◆ setGlowProperties()

void GlowEffect::setGlowProperties ( float  newRadius,
Colour  newColour,
Point< int offset = {} 
)

Sets the glow's radius and colour.

The radius is how large the blur should be, and the colour is used to render it (for a less intense glow, lower the colour's opacity).

Member Data Documentation

◆ colour

Colour GlowEffect::colour { Colours::white }
private

◆ offset

Point<int> GlowEffect::offset
private

◆ radius

float GlowEffect::radius = 2.0f
private

The documentation for this class was generated from the following file: