Provides support for signed distance fields to Starling meshes.

Signed distance field rendering allows bitmap fonts and other single colored shapes to be drawn without jagged edges, even at high magnifications. The technique was introduced in the SIGGRAPH paper Improved Alpha-Tested Magnification for Vector Textures and Special Effects by Valve Software.

While bitmap fonts are a great solution to render text in a GPU-friendly way, they don't scale well. For best results, one has to embed the font in all the sizes used within the app. The distance field style solves this issue: instead of providing a standard black and white image of the font, it uses a signed distance field texture as its input (a texture that encodes, for each pixel, the distance to the closest edge of a vector shape). With this data, the shape can be rendered smoothly at almost any scale.

Here are some tools that support creation of such distance field textures:

- Field Agent - a Ruby script that uses ImageMagick to create single-channel distance field textures. Part of the Starling download ('util' directory).
- msdfgen - an excellent and fast open source command line tool that creates multi- and single-channel distance field textures.

The former tools convert arbitrary SVG or PNG images to distance field textures. To create distance field fonts, have a look at the following alternatives:

- msdf-bmfont-xml - a command line tool powered by msdf and thus producing excellent multi-channel output.
- Littera - a free online bitmap font generator.
- Hiero - a cross platform tool.
- BMFont - Windows-only, from AngelCode.

Single-Channel vs. Multi-Channel

The original approach for distance field textures uses just a single channel (encoding the distance of each pixel to the shape that's being represented). By utilizing all three color channels, however, the results can be greatly enhanced - a technique developed by Viktor Chlumský.

Starling supports such multi-channel DF textures, as well. When using an appropriate texture, don't forget to enable the style's `multiChannel` property.

Special effects

Another advantage of this rendering technique: it supports very efficient rendering of some popular filter effects, in just one pass, directly on the GPU. You can add an outline around the shape, let it glow in an arbitrary color, or add a drop shadow.

The type of effect currently used is called the 'mode'. Meshes with the same mode will be batched together on rendering.

### Hierarchy

- MeshStyle
  - DistanceFieldStyle

## Index

### Constructors

- constructor

### Properties

- alpha
- color
- indexData
- mode
- multiChannel
- outerAlphaEnd
- outerAlphaStart
- outerColor
- outerThreshold
- shadowOffsetX
- shadowOffsetY
- softness
- target
- texture
- textureRepeat
- textureSmoothing
- threshold
- type
- vertexData
- vertexFormat
- MODE_BASIC
- MODE_GLOW
- MODE_OUTLINE
- MODE_SHADOW
- VERTEX_FORMAT

### Methods

- addEventListener
- batchIndexData
- batchVertexData
- canBatchWith
- clone
- copyFrom
- createEffect
- dispatchEvent
- dispatchEventWith
- getTexCoords
- getVertexAlpha
- getVertexColor
- getVertexPosition
- get_alpha
- get_color
- get_indexData
- get_mode
- get_multiChannel
- get_outerAlphaEnd
- get_outerAlphaStart
- get_outerColor
- get_outerThreshold
- get_shadowOffsetX
- get_shadowOffsetY
- get_softness
- get_target
- get_texture
- get_textureRepeat
- get_textureSmoothing
- get_threshold
- get_type
- get_vertexData
- get_vertexFormat
- hasEventListener
- removeEventListener
- removeEventListeners
- setTexCoords
- setVertexAlpha
- setVertexColor
- setVertexPosition
- set_alpha
- set_color
- set_mode
- set_multiChannel
- set_outerAlphaEnd
- set_outerAlphaStart
- set_outerColor
- set_outerThreshold
- set_shadowOffsetX
- set_shadowOffsetY
- set_softness
- set_texture
- set_textureRepeat
- set_textureSmoothing
- set_threshold
- setupBasic
- setupDropShadow
- setupGlow
- setupOutline
- updateEffect

## Constructors

### constructor

- new DistanceFieldStyle(softness?: number, threshold?: number): DistanceFieldStyle

- Overrides MeshStyle.constructor

  - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:86

  Creates a new distance field style.

  @param softness adds a soft transition between the inside and the outside. This should typically be 1.0 divided by the spread (in points) used when creating the distance field texture. @param threshold the value separating the inside from the outside of the shape. Range: 0 - 1.

  #### Parameters

  - ##### Optional softness: number

  - ##### Optional threshold: number

  #### Returns DistanceFieldStyle

## Properties

### alpha

alpha: number

- Defined in lib/starling/styles/DistanceFieldStyle.d.ts:172

The alpha value with which the inner area (what's rendered in 'basic' mode) is drawn. @default 1.0

### color

color: number

Inherited from MeshStyle.color

- Defined in lib/starling/styles/MeshStyle.d.ts:201

Changes the color of all vertices to the same value. The getter simply returns the color of the first vertex.

### indexData

indexData: IndexData

Inherited from MeshStyle.indexData

- Defined in lib/starling/styles/MeshStyle.d.ts:192

Returns a reference to the index data of the assigned target (or `null` if there is no target). Beware: the style itself does not own any indices; it is limited to manipulating those of the target mesh.

### mode

mode: string

- Defined in lib/starling/styles/DistanceFieldStyle.d.ts:145

The current render mode. It's recommended to use one of the 'setup...'-methods to change the mode, as those provide useful standard settings, as well. @default basic

### multiChannel

multiChannel: boolean

- Defined in lib/starling/styles/DistanceFieldStyle.d.ts:151

Indicates if the distance field texture utilizes multiple channels. This improves render quality, but requires specially created DF textures. @default false

### outerAlphaEnd

outerAlphaEnd: number

- Defined in lib/starling/styles/DistanceFieldStyle.d.ts:190

The alpha value on the outer side of the outer area's gradient. Used for outline, glow, and drop shadow modes.

### outerAlphaStart

outerAlphaStart: number

- Defined in lib/starling/styles/DistanceFieldStyle.d.ts:184

The alpha value on the inner side of the outer area's gradient. Used for outline, glow, and drop shadow modes.

### outerColor

outerColor: number

- Defined in lib/starling/styles/DistanceFieldStyle.d.ts:196

The color with which the outer area (outline, glow, or drop shadow) will be filled. Ignored in 'basic' mode.

### outerThreshold

outerThreshold: number

- Defined in lib/starling/styles/DistanceFieldStyle.d.ts:178

The threshold that determines where the outer area (outline, glow, or drop shadow) ends. Ignored in 'basic' mode.

### shadowOffsetX

shadowOffsetX: number

- Defined in lib/starling/styles/DistanceFieldStyle.d.ts:203

The x-offset of the shadow in points. Note that certain combinations of offset and blur value can lead the shadow to be cut off at the edges. Reduce blur or offset to counteract.

### shadowOffsetY

shadowOffsetY: number

- Defined in lib/starling/styles/DistanceFieldStyle.d.ts:210

The y-offset of the shadow in points. Note that certain combinations of offset and blur value can lead the shadow to be cut off at the edges. Reduce blur or offset to counteract.

### softness

softness: number

- Defined in lib/starling/styles/DistanceFieldStyle.d.ts:166

Indicates how soft the transition between inside and outside should be rendered. A value of '0' will lead to a hard, jagged edge; '1' will be just as blurry as the actual distance field texture. The recommend value should be `1.0 / spread` (you determine the spread when creating the distance field texture). @default 0.125

### target

target: Mesh

Inherited from MeshStyle.target

- Defined in lib/starling/styles/MeshStyle.d.ts:226

The target the style is currently assigned to.

### texture

texture: Texture

Inherited from MeshStyle.texture

- Defined in lib/starling/styles/MeshStyle.d.ts:210

The texture that is mapped to the mesh (or `null`, if there is none).

### textureRepeat

textureRepeat: boolean

Inherited from MeshStyle.textureRepeat

- Defined in lib/starling/styles/MeshStyle.d.ts:221

Indicates if pixels at the edges will be repeated or clamped. Only works for power-of-two textures. @default false

### textureSmoothing

textureSmoothing: string

Inherited from MeshStyle.textureSmoothing

- Defined in lib/starling/styles/MeshStyle.d.ts:215

The smoothing filter that is used for the texture. @default bilinear

### threshold

threshold: number

- Defined in lib/starling/styles/DistanceFieldStyle.d.ts:158

The threshold that will separate the inside from the outside of the shape. On the distance field texture, '0' means completely outside, '1' completely inside; the actual edge runs along '0.5'. @default 0.5

### type

type: any

Inherited from MeshStyle.type

- Defined in lib/starling/styles/MeshStyle.d.ts:196

The actual class of this style.

### vertexData

vertexData: VertexData

Inherited from MeshStyle.vertexData

- Defined in lib/starling/styles/MeshStyle.d.ts:186

Returns a reference to the vertex data of the assigned target (or `null` if there is no target). Beware: the style itself does not own any vertices; it is limited to manipulating those of the target mesh.

### vertexFormat

vertexFormat: VertexDataFormat

Inherited from MeshStyle.vertexFormat

- Defined in lib/starling/styles/MeshStyle.d.ts:206

The format used to store the vertices.

### Static MODE_BASIC

MODE_BASIC: string

- Defined in lib/starling/styles/DistanceFieldStyle.d.ts:77

Basic distance field rendering, without additional effects.

### Static MODE_GLOW

MODE_GLOW: string

- Defined in lib/starling/styles/DistanceFieldStyle.d.ts:83

Adds a smooth glow effect around the shape.

### Static MODE_OUTLINE

MODE_OUTLINE: string

- Defined in lib/starling/styles/DistanceFieldStyle.d.ts:80

Adds an outline around the edge of the shape.

### Static MODE_SHADOW

MODE_SHADOW: string

- Defined in lib/starling/styles/DistanceFieldStyle.d.ts:86

Adds a drop shadow behind the shape.

### Static VERTEX_FORMAT

VERTEX_FORMAT: VertexDataFormat

Overrides MeshStyle.VERTEX_FORMAT

- Defined in lib/starling/styles/DistanceFieldStyle.d.ts:74

The vertex format expected by this style.

## Methods

### addEventListener

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

- Inherited from MeshStyle.addEventListener

  Overrides EventDispatcher.addEventListener

  - Defined in lib/starling/styles/MeshStyle.d.ts:144

  #### Parameters

  - ##### type: string

  - ##### listener: Function

  #### Returns void

### batchIndexData

- batchIndexData(targetStyle: MeshStyle, targetIndexID?: number, offset?: number, indexID?: number, numIndices?: number): void

- Inherited from MeshStyle.batchIndexData

  - Defined in lib/starling/styles/MeshStyle.d.ts:139

  Copies the index data of the style's current target to the target of another style. The given offset value will be added to all indices during the process.

  This method is used when batching meshes together for rendering. The parameter `targetStyle` will point to the style of a `MeshBatch` (a subclass of `Mesh`). Subclasses may override this method if they need to modify the index data in that process.

  #### Parameters

  - ##### targetStyle: MeshStyle

  - ##### Optional targetIndexID: number

  - ##### Optional offset: number

  - ##### Optional indexID: number

  - ##### Optional numIndices: number

  #### Returns void

### Protected batchVertexData

- batchVertexData(targetStyle: MeshStyle, targetVertexID?: number, matrix?: Matrix, vertexID?: number, numVertices?: number): void

- Overrides MeshStyle.batchVertexData

  - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:105

  #### Parameters

  - ##### targetStyle: MeshStyle

  - ##### Optional targetVertexID: number

  - ##### Optional matrix: Matrix

  - ##### Optional vertexID: number

  - ##### Optional numVertices: number

  #### Returns void

### Protected canBatchWith

- canBatchWith(meshStyle: MeshStyle): boolean

- Overrides MeshStyle.canBatchWith

  - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:113

  #### Parameters

  - ##### meshStyle: MeshStyle

  #### Returns boolean

### clone

- clone(): MeshStyle

- Inherited from MeshStyle.clone

  - Defined in lib/starling/styles/MeshStyle.d.ts:98

  Creates a clone of this instance. The method will work for subclasses automatically, no need to override it.

  #### Returns MeshStyle

### Protected copyFrom

- copyFrom(meshStyle: MeshStyle): void

- Overrides MeshStyle.copyFrom

  - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:99

  #### Parameters

  - ##### meshStyle: MeshStyle

  #### Returns void

### Protected createEffect

- createEffect(): MeshEffect

- Overrides MeshStyle.createEffect

  - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:102

  #### Returns MeshEffect

### 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

### getTexCoords

- getTexCoords(vertexID: number, out?: Point): Point

- Inherited from MeshStyle.getTexCoords

  - Defined in lib/starling/styles/MeshStyle.d.ts:176

  Returns the texture coordinates of the vertex at the specified index.

  #### Parameters

  - ##### vertexID: number

  - ##### Optional out: Point

  #### Returns Point

### getVertexAlpha

- getVertexAlpha(vertexID: number): number

- Inherited from MeshStyle.getVertexAlpha

  - Defined in lib/starling/styles/MeshStyle.d.ts:164

  Returns the alpha value of the vertex at the specified index.

  #### Parameters

  - ##### vertexID: number

  #### Returns number

### getVertexColor

- getVertexColor(vertexID: number): number

- Inherited from MeshStyle.getVertexColor

  - Defined in lib/starling/styles/MeshStyle.d.ts:170

  Returns the RGB color of the vertex at the specified index.

  #### Parameters

  - ##### vertexID: number

  #### Returns number

### getVertexPosition

- getVertexPosition(vertexID: number, out?: Point): Point

- Inherited from MeshStyle.getVertexPosition

  - Defined in lib/starling/styles/MeshStyle.d.ts:159

  The position of the vertex at the specified index, in the mesh's local coordinate system.

  Only modify the position of a vertex if you know exactly what you're doing, as some classes might not work correctly when their vertices are moved. E.g. the `Quad` class expects its vertices to spawn up a perfectly rectangular area; some of its optimized methods won't work correctly if that premise is no longer fulfilled or the original bounds change.

  #### Parameters

  - ##### vertexID: number

  - ##### Optional out: Point

  #### Returns Point

### Protected get_alpha

- get_alpha(): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:173

  #### Returns number

### Protected get_color

- get_color(): number

- Inherited from MeshStyle.get_color

  - Defined in lib/starling/styles/MeshStyle.d.ts:202

  #### Returns number

### Protected get_indexData

- get_indexData(): IndexData

- Inherited from MeshStyle.get_indexData

  - Defined in lib/starling/styles/MeshStyle.d.ts:193

  #### Returns IndexData

### Protected get_mode

- get_mode(): string

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:146

  #### Returns string

### Protected get_multiChannel

- get_multiChannel(): boolean

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:152

  #### Returns boolean

### Protected get_outerAlphaEnd

- get_outerAlphaEnd(): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:191

  #### Returns number

### Protected get_outerAlphaStart

- get_outerAlphaStart(): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:185

  #### Returns number

### Protected get_outerColor

- get_outerColor(): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:197

  #### Returns number

### Protected get_outerThreshold

- get_outerThreshold(): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:179

  #### Returns number

### Protected get_shadowOffsetX

- get_shadowOffsetX(): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:204

  #### Returns number

### Protected get_shadowOffsetY

- get_shadowOffsetY(): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:211

  #### Returns number

### Protected get_softness

- get_softness(): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:167

  #### Returns number

### Protected get_target

- get_target(): Mesh

- Inherited from MeshStyle.get_target

  - Defined in lib/starling/styles/MeshStyle.d.ts:227

  #### Returns Mesh

### Protected get_texture

- get_texture(): Texture

- Inherited from MeshStyle.get_texture

  - Defined in lib/starling/styles/MeshStyle.d.ts:211

  #### Returns Texture

### Protected get_textureRepeat

- get_textureRepeat(): boolean

- Inherited from MeshStyle.get_textureRepeat

  - Defined in lib/starling/styles/MeshStyle.d.ts:222

  #### Returns boolean

### Protected get_textureSmoothing

- get_textureSmoothing(): string

- Inherited from MeshStyle.get_textureSmoothing

  - Defined in lib/starling/styles/MeshStyle.d.ts:216

  #### Returns string

### Protected get_threshold

- get_threshold(): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:159

  #### Returns number

### Protected get_type

- get_type(): any

- Inherited from MeshStyle.get_type

  - Defined in lib/starling/styles/MeshStyle.d.ts:197

  #### Returns any

### Protected get_vertexData

- get_vertexData(): VertexData

- Inherited from MeshStyle.get_vertexData

  - Defined in lib/starling/styles/MeshStyle.d.ts:187

  #### Returns VertexData

### Protected get_vertexFormat

- get_vertexFormat(): VertexDataFormat

- Inherited from MeshStyle.get_vertexFormat

  - Defined in lib/starling/styles/MeshStyle.d.ts:207

  #### Returns VertexDataFormat

### 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

### removeEventListener

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

- Inherited from MeshStyle.removeEventListener

  Overrides EventDispatcher.removeEventListener

  - Defined in lib/starling/styles/MeshStyle.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

### setTexCoords

- setTexCoords(vertexID: number, u: number, v: number): void

- Inherited from MeshStyle.setTexCoords

  - Defined in lib/starling/styles/MeshStyle.d.ts:179

  Sets the texture coordinates of the vertex at the specified index to the given values.

  #### Parameters

  - ##### vertexID: number

  - ##### u: number

  - ##### v: number

  #### Returns void

### setVertexAlpha

- setVertexAlpha(vertexID: number, alpha: number): void

- Inherited from MeshStyle.setVertexAlpha

  - Defined in lib/starling/styles/MeshStyle.d.ts:167

  Sets the alpha value of the vertex at the specified index to a certain value.

  #### Parameters

  - ##### vertexID: number

  - ##### alpha: number

  #### Returns void

### setVertexColor

- setVertexColor(vertexID: number, color: number): void

- Inherited from MeshStyle.setVertexColor

  - Defined in lib/starling/styles/MeshStyle.d.ts:173

  Sets the RGB color of the vertex at the specified index to a certain value.

  #### Parameters

  - ##### vertexID: number

  - ##### color: number

  #### Returns void

### setVertexPosition

- setVertexPosition(vertexID: number, x: number, y: number): void

- Inherited from MeshStyle.setVertexPosition

  - Defined in lib/starling/styles/MeshStyle.d.ts:161

  #### Parameters

  - ##### vertexID: number

  - ##### x: number

  - ##### y: number

  #### Returns void

### Protected set_alpha

- set_alpha(value: number): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:174

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_color

- set_color(value: number): number

- Inherited from MeshStyle.set_color

  - Defined in lib/starling/styles/MeshStyle.d.ts:203

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_mode

- set_mode(value: string): string

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:147

  #### Parameters

  - ##### value: string

  #### Returns string

### Protected set_multiChannel

- set_multiChannel(value: boolean): boolean

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:153

  #### Parameters

  - ##### value: boolean

  #### Returns boolean

### Protected set_outerAlphaEnd

- set_outerAlphaEnd(value: number): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:192

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_outerAlphaStart

- set_outerAlphaStart(value: number): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:186

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_outerColor

- set_outerColor(value: number): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:198

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_outerThreshold

- set_outerThreshold(value: number): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:180

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_shadowOffsetX

- set_shadowOffsetX(value: number): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:205

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_shadowOffsetY

- set_shadowOffsetY(value: number): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:212

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_softness

- set_softness(value: number): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:168

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_texture

- set_texture(value: Texture): Texture

- Inherited from MeshStyle.set_texture

  - Defined in lib/starling/styles/MeshStyle.d.ts:212

  #### Parameters

  - ##### value: Texture

  #### Returns Texture

### Protected set_textureRepeat

- set_textureRepeat(value: boolean): boolean

- Inherited from MeshStyle.set_textureRepeat

  - Defined in lib/starling/styles/MeshStyle.d.ts:223

  #### Parameters

  - ##### value: boolean

  #### Returns boolean

### Protected set_textureSmoothing

- set_textureSmoothing(value: string): string

- Inherited from MeshStyle.set_textureSmoothing

  - Defined in lib/starling/styles/MeshStyle.d.ts:217

  #### Parameters

  - ##### value: string

  #### Returns string

### Protected set_threshold

- set_threshold(value: number): number

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:160

  #### Parameters

  - ##### value: number

  #### Returns number

### setupBasic

- setupBasic(): void

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:118

  Restores basic render mode, i.e. smooth rendering of the shape.

  #### Returns void

### setupDropShadow

- setupDropShadow(blur?: number, offsetX?: number, offsetY?: number, color?: number, alpha?: number): void

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:138

  Sets up shadow rendering mode. The 'blur' determines the threshold where the drop shadow ends; 'offsetX' and 'offsetY' are expected in points.

  Beware that the style can only act within the limits of the mesh's vertices. This means that not all combinations of blur and offset are possible; too high values will cause the shadow to be cut off on the sides. Reduce either blur or offset to compensate.

  #### Parameters

  - ##### Optional blur: number

  - ##### Optional offsetX: number

  - ##### Optional offsetY: number

  - ##### Optional color: number

  - ##### Optional alpha: number

  #### Returns void

### setupGlow

- setupGlow(blur?: number, color?: number, alpha?: number): void

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:128

  Sets up glow rendering mode. The 'blur' determines the threshold where the blur ends; 'blur + threshold' must not exceed '1.0'.

  #### Parameters

  - ##### Optional blur: number

  - ##### Optional color: number

  - ##### Optional alpha: number

  #### Returns void

### setupOutline

- setupOutline(width?: number, color?: number, alpha?: number): void

- - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:123

  Sets up outline rendering mode. The 'width' determines the threshold where the outline ends; 'width + threshold' must not exceed '1.0'.

  #### Parameters

  - ##### Optional width: number

  - ##### Optional color: number

  - ##### Optional alpha: number

  #### Returns void

### Protected updateEffect

- updateEffect(effect: MeshEffect, state: RenderState): void

- Overrides MeshStyle.updateEffect

  - Defined in lib/starling/styles/DistanceFieldStyle.d.ts:110

  #### Parameters

  - ##### effect: MeshEffect

  - ##### state: RenderState

  #### Returns void

Generated using TypeDoc