LogoPixi’VN
pixi-jsClasses

Class: SystemRunner

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/system/SystemRunner.d.ts:44

Internal

SystemRunner is used internally by the renderers as an efficient way for systems to be notified about what the renderer is up to during the rendering phase.

import { SystemRunner } from 'pixi.js';

const myObject = {
    loaded: new SystemRunner('loaded')
}

const listener = {
    loaded: function(){
        // thin
    }
}

myObject.loaded.add(listener);

myObject.loaded.emit();

Or for handling calling the same function on many items

import { SystemRunner } from 'pixi.js';

const myGame = {
    update: new SystemRunner('update')
}

const gameObject = {
    update: function(time){
        // update my gamey state
    }
}

myGame.update.add(gameObject);

myGame.update.emit(time);

Constructors

Constructor

> new SystemRunner(name): SystemRunner

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/system/SystemRunner.d.ts:50

Parameters

name

string

The function name that will be executed on the listeners added to this Runner.

Returns

SystemRunner

Properties

items

> items: any[]

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/system/SystemRunner.d.ts:45

Accessors

empty

Get Signature

> get empty(): boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/system/SystemRunner.d.ts:93

true if there are no this Runner contains no listeners

Returns

boolean


name

Get Signature

> get name(): string

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/system/SystemRunner.d.ts:98

The name of the runner.

Returns

string

Methods

add()

> add(item): this

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/system/SystemRunner.d.ts:74

Add a listener to the Runner

Runners do not need to have scope or functions passed to them. All that is required is to pass the listening object and ensure that it has contains a function that has the same name as the name provided to the Runner when it was created.

Eg A listener passed to this Runner will require a 'complete' function.

import { Runner } from 'pixi.js';

const complete = new Runner('complete');

The scope used will be the object itself.

Parameters

item

unknown

The object that will be listening.

Returns

this


contains()

> contains(item): boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/system/SystemRunner.d.ts:84

Check to see if the listener is already in the Runner

Parameters

item

unknown

The listener that you would like to check.

Returns

boolean


destroy()

> destroy(): void

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/system/SystemRunner.d.ts:88

Remove all references, don't use after this.

Returns

void


emit()

> emit(a0?, a1?, a2?, a3?, a4?, a5?, a6?, a7?): this

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/system/SystemRunner.d.ts:55

Dispatch/Broadcast Runner to all listeners added to the queue.

Parameters

a0?

unknown

a1?

unknown

a2?

unknown

a3?

unknown

a4?

unknown

a5?

unknown

a6?

unknown

a7?

unknown

Returns

this


remove()

> remove(item): this

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/system/SystemRunner.d.ts:79

Remove a single listener from the dispatch queue.

Parameters

item

unknown

The listener that you would like to remove.

Returns

this


removeAll()

> removeAll(): this

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/system/SystemRunner.d.ts:86

Remove all listeners from the Runner

Returns

this