The GlowFilter class lets you apply a glow effect to display objects. It is similar to the drop shadow filter with the distance and angle properties set to 0.

This filter can also be used to create outlines around objects. The trick is to assign an alpha value that's (much) greater than `1.0`, and full resolution. For example, the following code will yield a nice black outline:

    object.filter = new GlowFilter(0x0, 30, 1, 1.0);

### Hierarchy

- FragmentFilter
  - GlowFilter

## Index

### Constructors

- constructor

### Properties

- alpha
- alwaysDrawToBackBuffer
- antiAliasing
- blur
- color
- isCached
- maintainResolutionAcrossPasses
- padding
- quality
- resolution
- textureFormat
- textureSmoothing

### Methods

- addEventListener
- cache
- clearCache
- dispatchEvent
- dispatchEventWith
- dispose
- get_alpha
- get_alwaysDrawToBackBuffer
- get_antiAliasing
- get_blur
- get_color
- get_isCached
- get_maintainResolutionAcrossPasses
- get_padding
- get_quality
- get_resolution
- get_textureFormat
- get_textureSmoothing
- hasEventListener
- process
- removeEventListener
- removeEventListeners
- render
- set_alpha
- set_alwaysDrawToBackBuffer
- set_antiAliasing
- set_blur
- set_color
- set_maintainResolutionAcrossPasses
- set_padding
- set_quality
- set_resolution
- set_textureFormat
- set_textureSmoothing

## Constructors

### constructor

- new GlowFilter(color?: number, alpha?: number, blur?: number, quality?: number): GlowFilter

- Overrides FragmentFilter.constructor

  - Defined in lib/starling/filters/GlowFilter.d.ts:21

  Initializes a new GlowFilter instance with the specified parameters.

  #### Parameters

  - ##### Optional color: number

    the color of the glow

  - ##### Optional alpha: number

    the alpha value of the glow. Values between 0 and 1 modify the opacity; values > 1 will make it stronger, i.e. produce a harder edge.

  - ##### Optional blur: number

    the amount of blur used to create the glow. Note that high values will cause the number of render passes to grow.

  - ##### Optional quality: number

    the quality of the glow's blur, '1' being the best (range 0.1 - 1.0)

  #### Returns GlowFilter

## Properties

### alpha

alpha: number

- Defined in lib/starling/filters/GlowFilter.d.ts:49

The alpha value of the glow. Values between 0 and 1 modify the opacity; values > 1 will make it stronger, i.e. produce a harder edge. @default 1.0

### alwaysDrawToBackBuffer

alwaysDrawToBackBuffer: boolean

Inherited from FragmentFilter.alwaysDrawToBackBuffer

- Defined in lib/starling/filters/FragmentFilter.d.ts:214

Indicates if the last filter pass is always drawn directly to the back buffer.

Per default, the filter tries to automatically render in a smart way: objects that are currently moving are rendered to the back buffer, objects that are static are rendered into a texture first, which allows the filter to be drawn directly from the render cache in the next frame (in case the object remains static).

However, this fails when filters are added to an object that does not support the render cache, or to a container with such a child (e.g. a Sprite3D object or a masked display object). In such a case, enable this property for maximum performance.

@default false

### antiAliasing

antiAliasing: number

Inherited from FragmentFilter.antiAliasing

- Defined in lib/starling/filters/FragmentFilter.d.ts:187

The anti-aliasing level. This is only used for rendering the target object into a texture, not for the filter passes. 0 - none, 4 - maximum. @default 0

### blur

blur: number

- Defined in lib/starling/filters/GlowFilter.d.ts:56

The amount of blur with which the glow is created. The number of required passes will be `Math.ceil(value) × 2`. @default 1.0

### color

color: number

- Defined in lib/starling/filters/GlowFilter.d.ts:43

The color of the glow. @default 0xffff00

### isCached

isCached: boolean

Inherited from FragmentFilter.isCached

- Defined in lib/starling/filters/FragmentFilter.d.ts:158

Indicates if the filter is cached (via the `cache` method).

### Protected maintainResolutionAcrossPasses

maintainResolutionAcrossPasses: boolean

Inherited from FragmentFilter.maintainResolutionAcrossPasses

- Defined in lib/starling/filters/FragmentFilter.d.ts:181

Indicates if the filter requires all passes to be processed with the exact same resolution.

Some filters must use the same resolution for input and output; e.g. the blur filter is very sensitive to changes of pixel / texel sizes. When the filter is used as part of a filter chain, or if its last pass is drawn directly to the back buffer, such a filter produces artifacts. In that case, the filter author must set this property to `true`.

@default false

### padding

padding: Padding

Inherited from FragmentFilter.padding

- Defined in lib/starling/filters/FragmentFilter.d.ts:152

Padding can extend the size of the filter texture in all directions. That's useful when the filter "grows" the bounds of the object in any direction.

### quality

quality: number

- Defined in lib/starling/filters/GlowFilter.d.ts:62

The quality used for blurring the glow. Forwarded to the internally used BlurFilter.

### resolution

resolution: number

Inherited from FragmentFilter.resolution

- Defined in lib/starling/filters/FragmentFilter.d.ts:166

The resolution of the filter texture. "1" means stage resolution, "0.5" half the stage resolution. A lower resolution saves memory and execution time, but results in a lower output quality. Values greater than 1 are allowed; such values might make sense for a cached filter when it is scaled up. @default 1

### textureFormat

textureFormat: string

Inherited from FragmentFilter.textureFormat

- Defined in lib/starling/filters/FragmentFilter.d.ts:197

The format of the filter texture. @default BGRA

### textureSmoothing

textureSmoothing: string

Inherited from FragmentFilter.textureSmoothing

- Defined in lib/starling/filters/FragmentFilter.d.ts:192

The smoothing mode of the filter texture. @default bilinear

## Methods

### Protected addEventListener

- addEventListener(type: string, listener: Function): void

- Inherited from FragmentFilter.addEventListener

  Overrides EventDispatcher.addEventListener

  - Defined in lib/starling/filters/FragmentFilter.d.ts:143

  #### Parameters

  - ##### type: string

  - ##### listener: Function

  #### Returns void

### cache

- cache(): void

- Inherited from FragmentFilter.cache

  - Defined in lib/starling/filters/FragmentFilter.d.ts:134

  Caches the filter output into a texture.

  An uncached filter is rendered every frame (except if it can be rendered from the global render cache, which happens if the target object does not change its appearance or location relative to the stage). A cached filter is only rendered once; the output stays unchanged until you call `cache` again or change the filter settings.

  Beware: you cannot cache filters on 3D objects; if the object the filter is attached to is a Sprite3D or has a Sprite3D as (grand-) parent, the request will be silently ignored. However, you can cache a 2D object that has 3D children!

  #### Returns void

### clearCache

- clearCache(): void

- Inherited from FragmentFilter.clearCache

  - Defined in lib/starling/filters/FragmentFilter.d.ts:138

  Clears the cached output of the filter. After calling this method, the filter will be processed once per frame again.

  #### Returns void

### dispatchEvent

- dispatchEvent(event: Event): void

- Inherited from EventDispatcher.dispatchEvent

  - Defined in lib/starling/events/EventDispatcher.d.ts:45

  Dispatches an event to all objects that have registered listeners for its type. If an event with enabled 'bubble' property is dispatched to a display object, it will travel up along the line of parents, until it either hits the root object or someone stops its propagation manually.

  #### Parameters

  - ##### event: Event

  #### Returns void

### dispatchEventWith

- dispatchEventWith(type: string, bubbles?: boolean, data?: any): void

- Inherited from EventDispatcher.dispatchEventWith

  - Defined in lib/starling/events/EventDispatcher.d.ts:50

  Dispatches an event with the given parameters to all objects that have registered listeners for the given type. The method uses an internal pool of event objects to avoid allocations.

  #### Parameters

  - ##### type: string

  - ##### Optional bubbles: boolean

  - ##### Optional data: any

  #### Returns void

### dispose

- dispose(): void

- Overrides FragmentFilter.dispose

  - Defined in lib/starling/filters/GlowFilter.d.ts:35
  inheritdoc

  #### Returns void

### Protected get_alpha

- get_alpha(): number

- - Defined in lib/starling/filters/GlowFilter.d.ts:50

  #### Returns number

### Protected get_alwaysDrawToBackBuffer

- get_alwaysDrawToBackBuffer(): boolean

- Inherited from FragmentFilter.get_alwaysDrawToBackBuffer

  - Defined in lib/starling/filters/FragmentFilter.d.ts:215

  #### Returns boolean

### Protected get_antiAliasing

- get_antiAliasing(): number

- Inherited from FragmentFilter.get_antiAliasing

  - Defined in lib/starling/filters/FragmentFilter.d.ts:188

  #### Returns number

### Protected get_blur

- get_blur(): number

- - Defined in lib/starling/filters/GlowFilter.d.ts:57

  #### Returns number

### Protected get_color

- get_color(): number

- - Defined in lib/starling/filters/GlowFilter.d.ts:44

  #### Returns number

### Protected get_isCached

- get_isCached(): boolean

- Inherited from FragmentFilter.get_isCached

  - Defined in lib/starling/filters/FragmentFilter.d.ts:159

  #### Returns boolean

### Protected get_maintainResolutionAcrossPasses

- get_maintainResolutionAcrossPasses(): boolean

- Inherited from FragmentFilter.get_maintainResolutionAcrossPasses

  - Defined in lib/starling/filters/FragmentFilter.d.ts:182

  #### Returns boolean

### Protected get_padding

- get_padding(): Padding

- Inherited from FragmentFilter.get_padding

  - Defined in lib/starling/filters/FragmentFilter.d.ts:153

  #### Returns Padding

### Protected get_quality

- get_quality(): number

- - Defined in lib/starling/filters/GlowFilter.d.ts:63

  #### Returns number

### Protected get_resolution

- get_resolution(): number

- Inherited from FragmentFilter.get_resolution

  - Defined in lib/starling/filters/FragmentFilter.d.ts:167

  #### Returns number

### Protected get_textureFormat

- get_textureFormat(): string

- Inherited from FragmentFilter.get_textureFormat

  - Defined in lib/starling/filters/FragmentFilter.d.ts:198

  #### Returns string

### Protected get_textureSmoothing

- get_textureSmoothing(): string

- Inherited from FragmentFilter.get_textureSmoothing

  - Defined in lib/starling/filters/FragmentFilter.d.ts:193

  #### Returns string

### hasEventListener

- hasEventListener(type: string, listener?: any): boolean

- Inherited from EventDispatcher.hasEventListener

  - Defined in lib/starling/events/EventDispatcher.d.ts:55

  If called with one argument, figures out if there are any listeners registered for the given event type. If called with two arguments, also determines if a specific listener is registered.

  #### Parameters

  - ##### type: string

  - ##### Optional listener: any

  #### Returns boolean

### Protected process

- process(painter: Painter, helper: IFilterHelper, input0?: Texture, input1?: Texture, input2?: Texture, input3?: Texture): Texture

- Overrides FragmentFilter.process

  - Defined in lib/starling/filters/GlowFilter.d.ts:38

  #### Parameters

  - ##### painter: Painter

  - ##### helper: IFilterHelper

  - ##### Optional input0: Texture

  - ##### Optional input1: Texture

  - ##### Optional input2: Texture

  - ##### Optional input3: Texture

  #### Returns Texture

### Protected removeEventListener

- removeEventListener(type: string, listener: Function): void

- Inherited from FragmentFilter.removeEventListener

  Overrides EventDispatcher.removeEventListener

  - Defined in lib/starling/filters/FragmentFilter.d.ts:146

  #### Parameters

  - ##### type: string

  - ##### listener: Function

  #### Returns void

### removeEventListeners

- removeEventListeners(type?: string): void

- Inherited from EventDispatcher.removeEventListeners

  - Defined in lib/starling/events/EventDispatcher.d.ts:39

  Removes all event listeners with a certain type, or all of them if type is null. Be careful when removing all event listeners: you never know who else was listening.

  #### Parameters

  - ##### Optional type: string

  #### Returns void

### render

- render(painter: Painter): void

- Inherited from FragmentFilter.render

  - Defined in lib/starling/filters/FragmentFilter.d.ts:99

  Renders the filtered target object. Most users will never have to call this manually; it's executed automatically in the rendering process of the filtered display object.

  #### Parameters

  - ##### painter: Painter

  #### Returns void

### Protected set_alpha

- set_alpha(value: number): number

- - Defined in lib/starling/filters/GlowFilter.d.ts:51

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_alwaysDrawToBackBuffer

- set_alwaysDrawToBackBuffer(value: boolean): boolean

- Inherited from FragmentFilter.set_alwaysDrawToBackBuffer

  - Defined in lib/starling/filters/FragmentFilter.d.ts:216

  #### Parameters

  - ##### value: boolean

  #### Returns boolean

### Protected set_antiAliasing

- set_antiAliasing(value: number): number

- Inherited from FragmentFilter.set_antiAliasing

  - Defined in lib/starling/filters/FragmentFilter.d.ts:189

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_blur

- set_blur(value: number): number

- - Defined in lib/starling/filters/GlowFilter.d.ts:58

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_color

- set_color(value: number): number

- - Defined in lib/starling/filters/GlowFilter.d.ts:45

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_maintainResolutionAcrossPasses

- set_maintainResolutionAcrossPasses(value: boolean): boolean

- Inherited from FragmentFilter.set_maintainResolutionAcrossPasses

  - Defined in lib/starling/filters/FragmentFilter.d.ts:183

  #### Parameters

  - ##### value: boolean

  #### Returns boolean

### Protected set_padding

- set_padding(value: Padding): Padding

- Inherited from FragmentFilter.set_padding

  - Defined in lib/starling/filters/FragmentFilter.d.ts:155

  #### Parameters

  - ##### value: Padding

  #### Returns Padding

### Protected set_quality

- set_quality(value: number): number

- - Defined in lib/starling/filters/GlowFilter.d.ts:64

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_resolution

- set_resolution(value: number): number

- Inherited from FragmentFilter.set_resolution

  - Defined in lib/starling/filters/FragmentFilter.d.ts:168

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_textureFormat

- set_textureFormat(value: string): string

- Inherited from FragmentFilter.set_textureFormat

  - Defined in lib/starling/filters/FragmentFilter.d.ts:199

  #### Parameters

  - ##### value: string

  #### Returns string

### Protected set_textureSmoothing

- set_textureSmoothing(value: string): string

- Inherited from FragmentFilter.set_textureSmoothing

  - Defined in lib/starling/filters/FragmentFilter.d.ts:194

  #### Parameters

  - ##### value: string

  #### Returns string

Generated using TypeDoc