Accessed via FlxG.plugins.

Variables

@:value([])read onlylist:Array<FlxBasic> = []

An array container for plugins.

Methods

@:genericinlineadd<T>(plugin:T):T

Deprecated: "FlxG.plugins.add is deprecated, use `addIfUniqueType` or `addPlugin`, instead.\nNote: In a later version `add` will be changed to behave like `addPlugin`"

Adds a new plugin to the global plugin array. DEPRECATED: In a later version this will be changed to behave like addPlugin.

Parameters:

plugin

Any object that extends FlxBasic. Useful for managers and other things.

Returns:

The same plugin you passed in.

addIfUniqueType<T>(plugin:T):T

Adds a new plugin to the global plugin array. Note: If there is already a plugin of this type, it will not be added

Parameters:

plugin

Any object that extends FlxBasic. Useful for managers and other things.

Returns:

The same plugin you passed in.

addPlugin<T>(plugin:T):T

Adds a new plugin to the global plugin array, does not check for existing instances of this type. Note: This is a temporary function. Eventually add will allow duplicates

Parameters:

plugin

Any object that extends FlxBasic. Useful for managers and other things.

Returns:

The same plugin you passed in.

get<T>(type:Class<T>):T

Retrieves the first plugin found that matches the specified type.

Parameters:

type

The class name of the plugin you want to retrieve. See the FlxPath or FlxTimer constructors for example usage.

Returns:

The plugin object, or null if no matching plugin was found.

inlineremove<T>(plugin:T):T

Removes an instance of a plugin from the global plugin array.

Parameters:

plugin

The plugin instance you want to remove.

Returns:

The same plugin you passed in.

inlineremoveType(type:Class<FlxBasic>):Bool

Deprecated: "FlxG.plugin.removeType is deprecated, use `removeAllByType` instead"

Removes all instances of a plugin from the global plugin array.

Parameters:

type

The class name of the plugin type you want removed from the array.

Returns:

Whether or not at least one instance of this plugin type was removed.