LookupPlugin
Defined in: plugins/LookupPlugin.ts:88
High-performance container lookup plugin for PIXI.js applications.
Provides O(1) lookup of containers using hierarchical path strings by maintaining bidirectional maps between paths and containers. Automatically tracks container hierarchy changes through global Container events.
Example
Section titled “Example”// Access containers by pathconst player = app.lookup.getChildAtPath('Game/Entities/Player');const menuButton = app.lookup.getChildAtPath('UI/MainMenu/StartButton');
// Get paths for containersconst playerPath = app.lookup.getPathForChild(playerSprite); // 'Game/Entities/Player'
Remarks
Section titled “Remarks”- Paths are built using container labels in hierarchical order
- Only containers with labels are included in paths
- Automatically handles container addition/removal through event listeners
- Uses Map data structures for optimal performance
Extends
Section titled “Extends”Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LookupPlugin(
id
):LookupPlugin
Defined in: plugins/Plugin.ts:48
Parameters
Section titled “Parameters”string
= 'Plugin'
Returns
Section titled “Returns”LookupPlugin
Inherited from
Section titled “Inherited from”Properties
Section titled “Properties”__dill_pixel_method_binding_root
Section titled “__dill_pixel_method_binding_root”__dill_pixel_method_binding_root:
boolean
Defined in: plugins/Plugin.ts:39
Inherited from
Section titled “Inherited from”Plugin
.__dill_pixel_method_binding_root
id:
string
='Plugin'
Defined in: plugins/Plugin.ts:48
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”name:
string
='lookup'
Defined in: plugins/LookupPlugin.ts:89
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get app():
A
Defined in: plugins/Plugin.ts:53
Returns
Section titled “Returns”A
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”coreFunctions
Section titled “coreFunctions”Get Signature
Section titled “Get Signature”get coreFunctions():
string
[]
Defined in: plugins/LookupPlugin.ts:100
Core function names exposed by this plugin for framework integration.
Returns
Section titled “Returns”string
[]
options
Section titled “options”Get Signature
Section titled “Get Signature”get options():
O
Defined in: plugins/Plugin.ts:44
Returns
Section titled “Returns”O
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”addSignalConnection()
Section titled “addSignalConnection()”addSignalConnection(…
args
):void
Defined in: plugins/Plugin.ts:79
Add signal connections to the container.
Parameters
Section titled “Parameters”…SignalConnection
[]
The signal connections to add.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”ILookupPlugin
.addSignalConnection
Inherited from
Section titled “Inherited from”clearSignalConnections()
Section titled “clearSignalConnections()”clearSignalConnections():
void
Defined in: plugins/Plugin.ts:85
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”ILookupPlugin
.clearSignalConnections
Inherited from
Section titled “Inherited from”destroy()
Section titled “destroy()”destroy():
void
Defined in: plugins/Plugin.ts:57
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”getAllChildren()
Section titled “getAllChildren()”getAllChildren():
Container
<ContainerChild
>[]
Defined in: plugins/LookupPlugin.ts:211
Gets all currently tracked containers. Useful for bulk operations or debugging.
Returns
Section titled “Returns”Container
<ContainerChild
>[]
Array of all container references in the lookup system
getAllPaths()
Section titled “getAllPaths()”getAllPaths():
string
[]
Defined in: plugins/LookupPlugin.ts:201
Gets all currently tracked hierarchical paths. Useful for debugging, serialization, or introspection.
Returns
Section titled “Returns”string
[]
Array of all path strings in the lookup system
Example
Section titled “Example”// Debug all tracked containersconst allPaths = lookup.getAllPaths();console.log('All tracked containers:', allPaths);
Implementation of
Section titled “Implementation of”getChildAtPath()
Section titled “getChildAtPath()”getChildAtPath(
path
):undefined
|Container
<ContainerChild
>
Defined in: plugins/LookupPlugin.ts:129
Fast O(1) lookup of container by hierarchical path.
Parameters
Section titled “Parameters”string
Slash-separated path like ‘Parent/Child/GrandChild’
Returns
Section titled “Returns”undefined
| Container
<ContainerChild
>
The container at the specified path, or undefined if not found
Example
Section titled “Example”// Get a specific UI elementconst healthBar = lookup.getChildAtPath('UI/HUD/HealthBar');if (healthBar) { // Update health display healthBar.visible = true;}
Implementation of
Section titled “Implementation of”getChildrenAtPaths()
Section titled “getChildrenAtPaths()”getChildrenAtPaths(…
paths
):Container
<ContainerChild
>[]
Defined in: plugins/LookupPlugin.ts:150
Batch retrieval of containers at multiple paths. Filters out undefined results for convenience.
Parameters
Section titled “Parameters”…string
[]
Variable number of hierarchical paths to look up
Returns
Section titled “Returns”Container
<ContainerChild
>[]
Array of found containers (undefined entries filtered out)
Example
Section titled “Example”// Get multiple UI elements at onceconst [menu, hud, inventory] = lookup.getChildrenAtPaths( 'UI/MainMenu', 'UI/HUD', 'UI/Inventory');
Implementation of
Section titled “Implementation of”ILookupPlugin
.getChildrenAtPaths
getPathForChild()
Section titled “getPathForChild()”getPathForChild(
container
):string
Defined in: plugins/LookupPlugin.ts:167
Get the hierarchical path for a given container.
Parameters
Section titled “Parameters”container
Section titled “container”Container
The container to get the path for
Returns
Section titled “Returns”string
The hierarchical path or empty string if not tracked
Example
Section titled “Example”// Get path for debugging or loggingconst containerPath = lookup.getPathForChild(someSprite);console.log(`Container is at: ${containerPath}`);
Implementation of
Section titled “Implementation of”getPathsForChildren()
Section titled “getPathsForChildren()”getPathsForChildren(…
containers
):string
[]
Defined in: plugins/LookupPlugin.ts:184
Batch retrieval of paths for multiple containers.
Parameters
Section titled “Parameters”containers
Section titled “containers”…Container
<ContainerChild
>[]
Variable number of PIXI containers to get paths for
Returns
Section titled “Returns”string
[]
Array of hierarchical paths for the containers
Example
Section titled “Example”// Get paths for multiple containers for debuggingconst paths = lookup.getPathsForChildren(sprite1, sprite2, sprite3);console.log('Container paths:', paths);
Implementation of
Section titled “Implementation of”ILookupPlugin
.getPathsForChildren
initialize()
Section titled “initialize()”initialize():
Promise
<void
>
Defined in: plugins/LookupPlugin.ts:108
Initializes the lookup plugin by connecting to global container events. Sets up automatic tracking of container hierarchy changes.
Returns
Section titled “Returns”Promise
<void
>
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”postInitialize()
Section titled “postInitialize()”postInitialize(
_app
):void
|Promise
<void
>
Defined in: plugins/Plugin.ts:68
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
| Promise
<void
>