Class: ParticleEmitter

Hierarchy

Constructors

constructor

new ParticleEmitter(data, resourceBase, layout, parentElement, options): ParticleEmitter

Parameters

Name Type
data ParticleEmitter
resourceBase string
layout LayoutInstance
parentElement Element
options LayoutCreateOptions

Returns

ParticleEmitter

Overrides

Element.constructor

Properties

activeData

activeData: ParticleEmitter

Overrides

Element.activeData


activeState

activeState: string

Inherited from

Element.activeState


alpha

Protected alpha: number

Inherited from

Element.alpha


children

Optional children: Element[]

Inherited from

Element.children


contentSize

Private contentSize: Size


data

data: ParticleEmitter

Overrides

Element.data


dirtyFlag

Protected dirtyFlag: DirtyFlag

Inherited from

Element.dirtyFlag


emitCache

Private Optional emitCache: Record<string, Emit[]>


emitDelayHandle

Private emitDelayHandle: null | number


eventCancels

Optional eventCancels: Record<string, () => void[]>

Inherited from

Element.eventCancels


filters

Protected filters: null | Filter[]

Inherited from

Element.filters


flip

Protected flip: number

Inherited from

Element.flip


isVisible

Protected isVisible: boolean

Inherited from

Element.isVisible


layout

layout: LayoutInstance

Inherited from

Element.layout


mask

Protected mask: null | Element

Inherited from

Element.mask


name

name: string

Inherited from

Element.name


parent

parent: null | Element

Inherited from

Element.parent


pixiDebug

pixiDebug: null | Graphics

Inherited from

Element.pixiDebug


pixiEmitter

pixiEmitter: null | Emitter


pixiParticleContainer

pixiParticleContainer: null | LinkedListContainer


size

Protected size: Size

Inherited from

Element.size


transform

Protected transform: default

Inherited from

Element.transform


updateSpawnShape

Private updateSpawnShape: null | (size: Size, scale: Size) => void


DEBUG_ALPHA

Static DEBUG_ALPHA: number = 0.5

Inherited from

Element.DEBUG_ALPHA


DEBUG_COLOR

Static DEBUG_COLOR: number = 0xff0000

Inherited from

Element.DEBUG_COLOR


isMute

Static isMute: boolean = false

Inherited from

Element.isMute

Accessors

cacheAsBitmap

get cacheAsBitmap(): boolean

Returns

boolean

Inherited from

Element.cacheAsBitmap

set cacheAsBitmap(value): void

Parameters

Name Type
value boolean

Returns

void

Inherited from

Element.cacheAsBitmap

Methods

adjust

adjust(realScreenSize, logicalScreenSize, parentSize, parentOffset?): void

Parameters

Name Type
realScreenSize Size
logicalScreenSize Size
parentSize Size
parentOffset? Size

Returns

void

Inherited from

Element.adjust


adjustChildren

adjustChildren(realScreenSize, logicalScreenSize, nodeSize): void

Parameters

Name Type
realScreenSize Size
logicalScreenSize Size
nodeSize Size

Returns

void

Inherited from

Element.adjustChildren


adjustHierarchy

adjustHierarchy(container, offset): number

Parameters

Name Type
container Container<DisplayObject>
offset number

Returns

number

Inherited from

Element.adjustHierarchy


animate

animate(state, animateStart, animateEnd, instant): null | Node

Parameters

Name Type
state string
animateStart () => void
animateEnd () => void
instant boolean

Returns

null | Node

Inherited from

Element.animate


cancelLocalEvent

cancelLocalEvent(eventName): boolean

Parameters

Name Type
eventName string

Returns

boolean

Inherited from

Element.cancelLocalEvent


clearDelayedEmit

clearDelayedEmit(): void

Returns

void


createChildren

createChildren(create, options): void

Parameters

Name Type
create (data: Node, options: LayoutCreateOptions) => Element
options LayoutCreateOptions

Returns

void

Inherited from

Element.createChildren


destroy

destroy(): void

Returns

void

Overrides

Element.destroy


destroyEmitter

destroyEmitter(): void

Returns

void


dirty

dirty(flag, recursive?): void

Mark the element as dirty. When the element is marked DIRTY the layout will be marked as requiring adjustment and all the parents of the element will be marked as CHILD_DIRTY unless they are already DIRTY.

Parameters

Name Type Default value Description
flag DirtyFlag undefined The dirty flag to set for the element
recursive boolean true If disabled the flag will only be set for this element

Returns

void

Inherited from

Element.dirty


getContentSize

getContentSize(): Size

Returns

Size

Overrides

Element.getContentSize


getDebugTitle

getDebugTitle(): string

Returns

string

Inherited from

Element.getDebugTitle


getDirty

getDirty(): DirtyFlag

Get the current dirty status of the element.

Returns

DirtyFlag

Inherited from

Element.getDirty


getMask

getMask(): null | Element

Returns

null | Element

Inherited from

Element.getMask


getNode

getNode(this, matcher): undefined | Element

Returns the first node from the hierarchy, including this one, that matches the filtering options.

Parameters

Name Type Description
this Element -
matcher Matcher<Element> Filtering options

Returns

undefined | Element

Inherited from

Element.getNode

getNode(this, filter): undefined | Element

Returns the first node from the hierarchy, including this one, whose name matches the provided filter.

Parameters

Name Type Description
this Element -
filter Filter String or RegExp for filtering the nodes

Returns

undefined | Element

Inherited from

Element.getNode

getNode<T2>(this, type): undefined | T2

Returns the first node from the hierarchy, including this one, whose type matches the provided type.

Type parameters

Name Type
T2 extends Element

Parameters

Name Type Description
this Element -
type Type<T2> Type for filtering the nodes

Returns

undefined | T2

Inherited from

Element.getNode

getNode<T2>(this, type, filter): undefined | T2

Returns the first node from the hierarchy, including this one, whose type matches the provided type and name matches the provided filter.

Type parameters

Name Type
T2 extends Element

Parameters

Name Type Description
this Element -
type Type<T2> Type for filtering the nodes
filter Filter String or RegExp for filtering the nodes

Returns

undefined | T2

Inherited from

Element.getNode


getPixiObject

getPixiObject(): null | LinkedListContainer

Returns

null | LinkedListContainer

Overrides

Element.getPixiObject


isWorldVisible

isWorldVisible(): boolean

Check whether the element is visible or not. Because of the hierarchy optimizations it is not possible to use DisplayObject.worldVisible to check for the visibility as non-visible nodes will still have the old parent reference.

Returns

boolean

Inherited from

Element.isWorldVisible


localEvent

localEvent(states, params?): Promise<void>

Parameters

Name Type
states string | Event[]
params? EventParams

Returns

Promise<void>

Inherited from

Element.localEvent


match

match(this, «destructured»): boolean

Test node type and/or name for a match.

Parameters

Name Type
this Element
«destructured» Matcher<Element>

Returns

boolean

Inherited from

Element.match


nodes

nodes(this): Generator<Element, any, unknown>

Iterate over all nodes in the hierarchy, including this one.

Parameters

Name Type
this Element

Returns

Generator<Element, any, unknown>

Inherited from

Element.nodes

nodes(this, matcher): Generator<Element, any, unknown>

Iterate over all nodes in the hierarchy, including this one. Can optionally filter the nodes based on type and/or name.

Parameters

Name Type Description
this Element -
matcher Matcher<Element> Filtering options

Returns

Generator<Element, any, unknown>

Inherited from

Element.nodes

nodes(this, filter): Generator<Element, any, unknown>

Iterate over all nodes in the hierarchy, including this one. The iterator skips nodes whose name does not match the provided filter.

Parameters

Name Type Description
this Element -
filter Filter String or RegExp for filtering the nodes

Returns

Generator<Element, any, unknown>

Inherited from

Element.nodes

nodes<T2>(this, type): Generator<T2, any, unknown>

Iterate over all nodes in the hierarchy, including this one. The iterator skips nodes whose type does not match the provided type.

Type parameters

Name Type
T2 extends Element

Parameters

Name Type Description
this Element -
type Type<T2> Type for filtering the nodes

Returns

Generator<T2, any, unknown>

Inherited from

Element.nodes

nodes<T2>(this, type, filter): Generator<T2, any, unknown>

Iterate over all nodes in the hierarchy, including this one. The iterator skips nodes whose type does not match the provided type or name does not match the provided filter.

Type parameters

Name Type
T2 extends Element

Parameters

Name Type Description
this Element -
type Type<T2> Type for filtering the nodes
filter Filter String or RegExp for filtering the nodes

Returns

Generator<T2, any, unknown>

Inherited from

Element.nodes


offClick

offClick(): void

Unregister the previously registered click handler. It is safe to call this even when no click handler is registered.

Returns

void

Inherited from

Element.offClick


offDrag

offDrag(): void

Unregister the previously registered drag handler. It is safe to call this even when no drag handler is registered.

Returns

void

Inherited from

Element.offDrag


offHover

offHover(): void

Unregister a previously registered hover handler. It is safe to call this even when no hover handler is registered.

If the cursor is hovering on the element when offHover is called the leave state will be triggered to reset the visual states. However the registered leave callback will not be called.

Returns

void

Inherited from

Element.offHover


onClick

onClick<T>(this, callback, eventParams?): void

Register a click handler with a callback. If the element data has a click trigger an event with that name will be automatically triggered when the callback is called. If a click handler has already been registered it will be cleared with a warning.

Type parameters

Name Type
T extends Element

Parameters

Name Type Description
this T -
callback ClickCallback<T> The callback to call when the element is clicked
eventParams? EventParams Optional event parameters for the click event

Returns

void

Inherited from

Element.onClick


onDrag

onDrag<T>(this, callback?): void

Register a drag handler with a callback. Whether the element dragging acts as scroll or drag is determined by the dragX and dragY settings in the trigger data. By default the callback is called with the drag offset but if dragStepsX or dragStepsY is enabled the value will be the index of the step for the respective axis. If a drag handler has already been registered it will be cleared with a warning.

Type parameters

Name Type
T extends Element

Parameters

Name Type Description
this T -
callback? DragCallback<T> Optional callback to call when the element is dragged

Returns

void

Inherited from

Element.onDrag


onHover

onHover<T>(this, callbacks?): void

Register a hover handler with enter and leave callbacks. If the element data has hoverEnter or hoverLeave triggers the corresponding states will be automatically set when the callbacks are called. If a hover handler has already been registered it will be cleared with a warning.

Type parameters

Name Type
T extends Element

Parameters

Name Type Description
this T -
callbacks? Partial<HoverCallbacks<T>> Optional callbacks to call when the cursor enters or leaves the element

Returns

void

Inherited from

Element.onHover


registerStates

registerStates(register): void

Parameters

Name Type
register (state: string) => void

Returns

void

Overrides

Element.registerStates


requireNode

requireNode(this, matcher): Element

Returns the first node from the hierarchy, including this one, that matches the filtering options. Throws an error if the node is not found.

Parameters

Name Type Description
this Element -
matcher Matcher<Element> Filtering options

Returns

Element

Inherited from

Element.requireNode

requireNode(this, filter): Element

Returns the first node from the hierarchy, including this one, whose name matches the provided filter. Throws an error if the node is not found.

Parameters

Name Type Description
this Element -
filter Filter String or RegExp for filtering the nodes

Returns

Element

Inherited from

Element.requireNode

requireNode<T2>(this, type): T2

Returns the first node from the hierarchy, including this one, whose type matches the provided type. Throws an error if the node is not found.

Type parameters

Name Type
T2 extends Element

Parameters

Name Type Description
this Element -
type Type<T2> Type for filtering the nodes

Returns

T2

Inherited from

Element.requireNode

requireNode<T2>(this, type, filter): T2

Returns the first node from the hierarchy, including this one, whose type matches the provided type and name matches the provided filter. Throws an error if the node is not found.

Type parameters

Name Type
T2 extends Element

Parameters

Name Type Description
this Element -
type Type<T2> Type for filtering the nodes
filter Filter String or RegExp for filtering the nodes

Returns

T2

Inherited from

Element.requireNode


setDebug

setDebug(debug): void

Parameters

Name Type
debug boolean

Returns

void

Inherited from

Element.setDebug


setDragOffset

setDragOffset(offset, duration?, easing?): Promise<void>

Set drag offset. By default the offset is set instantly but a transition effect can be enabled by providing duration and an easing function.

The returned promise resolves once the target offset is reached, or if another setDragOffset call or manual dragging interrupts the transition.

Parameters

Name Type Description
offset Size Offset in logical screen coordinates or snap steps
duration? number Duration of the transition in seconds
easing? Easing Easing function for the transition

Returns

Promise<void>

Inherited from

Element.setDragOffset


setEmitter

setEmitter(textures, config): void

Parameters

Name Type
textures Texture<Resource>[]
config EmitterConfigV2

Returns

void


setLocalState

setLocalState(state, options?): Promise<boolean>

Parameters

Name Type
state string
options? Object
options.instant? boolean
options.skipChildren? boolean
options.validate? boolean

Returns

Promise<boolean>

Inherited from

Element.setLocalState


setMask

setMask(mask): void

Parameters

Name Type
mask Element

Returns

void

Inherited from

Element.setMask


setState

setState(state, animateStart, animateEnd, instant): boolean

Parameters

Name Type
state string
animateStart () => void
animateEnd () => void
instant boolean

Returns

boolean

Overrides

Element.setState


updateAlpha

updateAlpha(alpha, parentAlpha): boolean

Parameters

Name Type
alpha number
parentAlpha number

Returns

boolean

Inherited from

Element.updateAlpha


updateInteractions

updateInteractions(group): void

Parameters

Name Type
group GroupContainer

Returns

void

Inherited from

Element.updateInteractions


updatePixiObject

updatePixiObject(realScreenSize, logicalScreenSize, transform, size, flip, alpha): void

Parameters

Name Type
realScreenSize Size
logicalScreenSize Size
transform Transform
size Size
flip number
alpha number

Returns

void

Overrides

Element.updatePixiObject


updateStateCache

updateStateCache(): void

Returns

void

Overrides

Element.updateStateCache


collectResources

collectResources(data, resourceBase, resources): void

Parameters

Name Type
data ParticleEmitter
resourceBase string
resources Resource[]

Returns

void

Overrides

Element.collectResources


setDebugColor

setDebugColor(debugColor, debugAlpha?): void

Parameters

Name Type Default value
debugColor number undefined
debugAlpha number 1

Returns

void

Inherited from

Element.setDebugColor


setGlobalMute

setGlobalMute(isMute): void

Parameters

Name Type
isMute boolean

Returns

void

Inherited from

Element.setGlobalMute