Application
Defined in: core/Application.ts:115
Represents the core application interface, extending PixiJS Application. It manages plugins, game state, actions, and provides access to various application subsystems.
Example
Section titled “Example”import { Application } from '@dillpixel/framework';
// Define your data schema, action context, and actionsinterface MyDataSchema { score: number; playerName: string;}
interface MyActionContext { userId: string;}
type MyActions = 'startGame' | 'endGame' | 'updateScore';
// Create a new application instanceconst app = new Application<MyDataSchema, MyActionContext, MyActions>();
async function main() { await app.initialize({ // Application configuration appName: 'My Awesome Game', // ... other config options }, document.getElementById('game-container'));
// Access application properties and methods console.log(app.appName); // 'My Awesome Game' app.scenes.load('mainMenu'); app.action('startGame');}
main();
Extends
Section titled “Extends”Application
<R
>
Type Parameters
Section titled “Type Parameters”D
extends DataSchema
= DataSchema
The type of the data schema used by the application’s store.
C
extends ActionContext
= ActionContext
The type of the action context used for dispatching actions.
The type of actions that can be dispatched in the application.
R
extends Renderer
= Renderer
Implements
Section titled “Implements”IApplication
<D
,C
,A
>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Application<
D
,C
,A
,R
>():Application
<D
,C
,A
,R
>
Defined in: core/Application.ts:245
Returns
Section titled “Returns”Application
<D
, C
, A
, R
>
Overrides
Section titled “Overrides”PIXIPApplication<R>.constructor
Properties
Section titled “Properties”__dill_pixel_method_binding_root
Section titled “__dill_pixel_method_binding_root”__dill_pixel_method_binding_root:
boolean
=true
Defined in: core/Application.ts:126
config
Section titled “config”
readonly
config:Partial
<IApplicationOptions
<D
>>
Defined in: core/Application.ts:128
The application configuration object. Contains settings for various aspects of the application, including plugins, assets, and scenes.
Example
Section titled “Example”console.log(app.config.appName); // 'My Awesome Game'if (app.config.showStats) { // Show performance stats}
Implementation of
Section titled “Implementation of”manifest
Section titled “manifest”
readonly
manifest:undefined
|string
|AssetsManifest
Defined in: core/Application.ts:131
The asset manifest used by the application. Can be a URL to a manifest file, or an AssetsManifest object.
Example
Section titled “Example”console.log(app.manifest); // Could be './assets.json' or an object
Implementation of
Section titled “Implementation of”onPause
Section titled “onPause”onPause:
Signal
<(config
) =>void
>
Defined in: core/Application.ts:132
A signal that emits when the application is paused.
Example
Section titled “Example”app.onPause.connect(() => { console.log('Application paused'); // Stop game-specific timers or animations not handled by app.pause()});
Implementation of
Section titled “Implementation of”onResize
Section titled “onResize”onResize:
Signal
<(size
) =>void
>
Defined in: core/Application.ts:135
onResume
Section titled “onResume”onResume:
Signal
<(config
) =>void
>
Defined in: core/Application.ts:133
A signal that emits when the application is resumed from a paused state.
Example
Section titled “Example”app.onResume.connect(() => { console.log('Application resumed'); // Restart game-specific timers or animations});
Implementation of
Section titled “Implementation of”plugins
Section titled “plugins”plugins:
ImportList
<IPlugin
<any
>>
Defined in: core/Application.ts:129
storageAdapters
Section titled “storageAdapters”storageAdapters:
ImportList
<IStorageAdapter
>
Defined in: core/Application.ts:130
containerElement
Section titled “containerElement”
static
containerElement:HTMLElement
Defined in: core/Application.ts:124
Accessors
Section titled “Accessors”actionContext
Section titled “actionContext”Get Signature
Section titled “Get Signature”get actionContext():
C
Defined in: core/Application.ts:463
The current context for dispatching actions. Allows passing additional contextual information when actions are triggered.
Example
Section titled “Example”app.actionContext = { userId: 'user123', source: 'uiButton' };app.action('submitScore', { score: 1000 }); // Context will be included
Returns
Section titled “Returns”C
Set Signature
Section titled “Set Signature”set actionContext(
context
):void
Defined in: core/Application.ts:467
The current context for dispatching actions. Allows passing additional contextual information when actions are triggered.
Example
Section titled “Example”app.actionContext = { userId: 'user123', source: 'uiButton' };app.action('submitScore', { score: 1000 }); // Context will be included
Parameters
Section titled “Parameters”context
Section titled “context”C
Returns
Section titled “Returns”void
The current context for dispatching actions. Allows passing additional contextual information when actions are triggered.
Example
Section titled “Example”app.actionContext = { userId: 'user123', source: 'uiButton' };app.action('submitScore', { score: 1000 }); // Context will be included
Implementation of
Section titled “Implementation of”actionsPlugin
Section titled “actionsPlugin”Get Signature
Section titled “Get Signature”get actionsPlugin():
IActionsPlugin
<C
>
Defined in: core/Application.ts:296
Returns
Section titled “Returns”Get Signature
Section titled “Get Signature”get anim(): typeof
gsap
Defined in: core/Application.ts:334
The GSAP instance.
Returns
Section titled “Returns”typeof gsap
The GSAP instance.
The global GSAP instance.
Direct access to the gsap
object for creating tweens and timelines.
Example
Section titled “Example”app.anim.to(mySprite.scale, { x: 1.5, y: 1.5, duration: 0.5, ease: 'power2.inOut' });
Implementation of
Section titled “Implementation of”animation
Section titled “animation”Get Signature
Section titled “Get Signature”get animation():
IGSAPPlugin
Defined in: core/Application.ts:326
The GSAP plugin.
Returns
Section titled “Returns”The GSAP plugin.
The GSAPPlugin instance for managing animations. Provides access to GSAP functionality and animation contexts.
Example
Section titled “Example”const timeline = app.animation.createTimeline();timeline.to(mySprite, { alpha: 0, duration: 1 });
Implementation of
Section titled “Implementation of”appName
Section titled “appName”Get Signature
Section titled “Get Signature”get appName():
string
Defined in: core/Application.ts:264
The name of the application. Defined in the application configuration.
Example
Section titled “Example”document.title = app.appName;
Returns
Section titled “Returns”string
The name of the application. Defined in the application configuration.
Example
Section titled “Example”document.title = app.appName;
Implementation of
Section titled “Implementation of”appVersion
Section titled “appVersion”Get Signature
Section titled “Get Signature”get appVersion():
string
|number
Defined in: core/Application.ts:252
The version of the application.
Typically injected at build time (e.g., via __DILL_PIXEL_APP_VERSION
).
Example
Section titled “Example”console.log(`Running ${app.appName} v${app.appVersion}`);
Returns
Section titled “Returns”string
| number
The version of the application.
Typically injected at build time (e.g., via __DILL_PIXEL_APP_VERSION
).
Example
Section titled “Example”console.log(`Running ${app.appName} v${app.appVersion}`);
Implementation of
Section titled “Implementation of”assets
Section titled “assets”Get Signature
Section titled “Get Signature”get assets():
IAssetsPlugin
Defined in: core/Application.ts:403
The AssetsPlugin instance for managing game assets. Provides methods for loading and accessing textures, sounds, fonts, etc.
Example
Section titled “Example”const playerTexture = await app.assets.load('playerSprite');const backgroundMusic = app.assets.getSound('bgm');
Returns
Section titled “Returns”The AssetsPlugin instance for managing game assets. Provides methods for loading and accessing textures, sounds, fonts, etc.
Example
Section titled “Example”const playerTexture = await app.assets.load('playerSprite');const backgroundMusic = app.assets.getSound('bgm');
Implementation of
Section titled “Implementation of”Get Signature
Section titled “Get Signature”get audio():
IAudioManagerPlugin
Defined in: core/Application.ts:456
The AudioManagerPlugin instance for managing game audio. Handles sound effects and background music.
Example
Section titled “Example”app.audio.playSound('explosion');app.audio.setMusicVolume(0.7);
Returns
Section titled “Returns”The AudioManagerPlugin instance for managing game audio. Handles sound effects and background music.
Example
Section titled “Example”app.audio.playSound('explosion');app.audio.setMusicVolume(0.7);
Implementation of
Section titled “Implementation of”canFullscreen
Section titled “canFullscreen”Get Signature
Section titled “Get Signature”get canFullscreen():
boolean
Defined in: core/Application.ts:500
Returns
Section titled “Returns”boolean
captions
Section titled “captions”Get Signature
Section titled “Get Signature”get captions():
ICaptionsPlugin
Defined in: core/Application.ts:478
Returns
Section titled “Returns”ICaptionsPlugin
center
Section titled “center”Get Signature
Section titled “Get Signature”get center():
Point
Defined in: core/Application.ts:372
The center point (x, y) of the application’s view/canvas. Automatically updated when the application resizes.
Example
Section titled “Example”// Center a sprite on the screenmySprite.position.copyFrom(app.center);
Returns
Section titled “Returns”Point
The center point (x, y) of the application’s view/canvas. Automatically updated when the application resizes.
Example
Section titled “Example”// Center a sprite on the screenmySprite.position.copyFrom(app.center);
Implementation of
Section titled “Implementation of”controls
Section titled “controls”Get Signature
Section titled “Get Signature”get controls():
IControls
Defined in: core/Application.ts:314
The Controls instance, typically accessed via the InputPlugin. Provides a higher-level abstraction for game controls and actions.
Example
Section titled “Example”if (app.controls.isActionActive('jump')) { // Player jumps}
Returns
Section titled “Returns”The Controls instance, typically accessed via the InputPlugin. Provides a higher-level abstraction for game controls and actions.
Example
Section titled “Example”if (app.controls.isActionActive('jump')) { // Player jumps}
Implementation of
Section titled “Implementation of”Get Signature
Section titled “Get Signature”get data():
IDataAdapter
<D
>
Defined in: core/Application.ts:802
Get a storage adapter by id
Returns
Section titled “Returns”IDataAdapter
<D
>
The primary DataAdapter instance, usually for managing game data.
Example
Section titled “Example”const playerData = await app.data.get('playerStats');await app.data.set('playerStats', { health: 100, mana: 50 });
Implementation of
Section titled “Implementation of”Get Signature
Section titled “Get Signature”get env():
Record
<string
,string
>
Defined in: core/Application.ts:167
Environment variables available to the application.
Typically sourced from import.meta.env
.
Example
Section titled “Example”const apiKey = app.env.API_KEY;if (app.env.NODE_ENV === 'development') { // Enable debug features}
Returns
Section titled “Returns”Record
<string
, string
>
Environment variables available to the application.
Typically sourced from import.meta.env
.
Example
Section titled “Example”const apiKey = app.env.API_KEY;if (app.env.NODE_ENV === 'development') { // Enable debug features}
Implementation of
Section titled “Implementation of”Get Signature
Section titled “Get Signature”get exec():
ICoreFunctions
Defined in: core/Application.ts:537
Alias for func
. Access to core application functions.
Returns
Section titled “Returns”Alias for func
. Access to core application functions.
Implementation of
Section titled “Implementation of”Get Signature
Section titled “Get Signature”get focus():
IFocusManagerPlugin
Defined in: core/Application.ts:431
The FocusManagerPlugin instance for managing UI focus.
Returns
Section titled “Returns”The FocusManagerPlugin instance for managing UI focus.
Implementation of
Section titled “Implementation of”fullScreen
Section titled “fullScreen”Get Signature
Section titled “Get Signature”get fullScreen():
IFullScreenPlugin
Defined in: core/Application.ts:485
Fullscreen plugin
Returns
Section titled “Returns”fullScreenElement
Section titled “fullScreenElement”Get Signature
Section titled “Get Signature”get fullScreenElement():
null
|HTMLElement
|Window
Defined in: core/Application.ts:492
Returns
Section titled “Returns”null
| HTMLElement
| Window
Get Signature
Section titled “Get Signature”get func():
ICoreFunctions
Defined in: core/Application.ts:533
Access to core application functions. Provides a registry for globally accessible utility functions.
Example
Section titled “Example”const utility = app.func.get('myUtility');if (utility) utility.doSomething();
Returns
Section titled “Returns”Access to core application functions. Provides a registry for globally accessible utility functions.
Example
Section titled “Example”const utility = app.func.get('myUtility');if (utility) utility.doSomething();
Implementation of
Section titled “Implementation of”Get Signature
Section titled “Get Signature”get i18n():
Ii18nPlugin
Defined in: core/Application.ts:277
The i18nPlugin instance for internationalization and localization.
Example
Section titled “Example”const localizedGreeting = app.i18n.translate('GREETING_KEY');app.i18n.setLocale('fr-FR');
Returns
Section titled “Returns”The i18nPlugin instance for internationalization and localization.
Example
Section titled “Example”const localizedGreeting = app.i18n.translate('GREETING_KEY');app.i18n.setLocale('fr-FR');
Implementation of
Section titled “Implementation of”Get Signature
Section titled “Get Signature”get input():
IInputPlugin
Defined in: core/Application.ts:306
The InputPlugin instance for managing various input sources. This often consolidates controls from keyboard, mouse, gamepad, etc.
Returns
Section titled “Returns”The InputPlugin instance for managing various input sources. This often consolidates controls from keyboard, mouse, gamepad, etc.
Implementation of
Section titled “Implementation of”isFullScreen
Section titled “isFullScreen”Get Signature
Section titled “Get Signature”get isFullScreen():
boolean
Defined in: core/Application.ts:496
Returns
Section titled “Returns”boolean
isMobile
Section titled “isMobile”Get Signature
Section titled “Get Signature”get isMobile():
boolean
Defined in: core/Application.ts:517
End Fullscreen plugin
Returns
Section titled “Returns”boolean
isTouch
Section titled “isTouch”Get Signature
Section titled “Get Signature”get isTouch():
boolean
Defined in: core/Application.ts:521
Returns
Section titled “Returns”boolean
keyboard
Section titled “keyboard”Get Signature
Section titled “Get Signature”get keyboard():
IKeyboardPlugin
Defined in: core/Application.ts:424
The KeyboardPlugin instance for managing keyboard input.
Example
Section titled “Example”if (app.keyboard.isKeyDown('Space')) { // Player jumps}app.keyboard.onKeyDown.connect((keyEvent) => { if(keyEvent.key === 'Escape') app.scenes.load('pauseMenu');});
Returns
Section titled “Returns”The KeyboardPlugin instance for managing keyboard input.
Example
Section titled “Example”if (app.keyboard.isKeyDown('Space')) { // Player jumps}app.keyboard.onKeyDown.connect((keyEvent) => { if(keyEvent.key === 'Escape') app.scenes.load('pauseMenu');});
Implementation of
Section titled “Implementation of”lookup
Section titled “lookup”Get Signature
Section titled “Get Signature”get lookup():
ILookupPlugin
Defined in: core/Application.ts:376
Returns
Section titled “Returns”Get Signature
Section titled “Get Signature”get make():
object
Defined in: core/Application.ts:160
Returns
Section titled “Returns”object
animatedSprite()
Section titled “animatedSprite()”animatedSprite: (
props?
) =>AnimatedSprite
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<AnimatedSpriteProps
>
Returns
Section titled “Returns”bitmapText()
Section titled “bitmapText()”bitmapText: (
props?
) =>BitmapText
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<TextProps
>
Returns
Section titled “Returns”BitmapText
button()
Section titled “button()”button: (
props?
) =>Button
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<ButtonProps
>
Returns
Section titled “Returns”container()
Section titled “container()”container: (
props?
) =>Container
<Application
<DataSchema
,ActionContext
,Action
,Renderer
>>
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<ContainerProps
>
Returns
Section titled “Returns”Container
<Application
<DataSchema
, ActionContext
, Action
, Renderer
>>
existing()
Section titled “existing()”existing: <
TEntity
>(entity
,props?
) =>TEntity
Type Parameters
Section titled “Type Parameters”TEntity
Section titled “TEntity”TEntity
Parameters
Section titled “Parameters”entity
Section titled “entity”TEntity
props?
Section titled “props?”Partial
<ExistingProps
>
Returns
Section titled “Returns”TEntity
flexContainer()
Section titled “flexContainer()”flexContainer: (
props?
) =>FlexContainer
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<FlexContainerProps
>
Returns
Section titled “Returns”graphics()
Section titled “graphics()”graphics: (
props?
) =>Graphics
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<GraphicsProps
>
Returns
Section titled “Returns”Graphics
htmlText()
Section titled “htmlText()”htmlText: (
props?
) =>HTMLText
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<HTMLTextProps
>
Returns
Section titled “Returns”HTMLText
particleContainer()
Section titled “particleContainer()”particleContainer: (
props?
) =>ParticleContainer
<Application
<DataSchema
,ActionContext
,Action
,Renderer
>>
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<ParticleContainerProps
>
Returns
Section titled “Returns”ParticleContainer
<Application
<DataSchema
, ActionContext
, Action
, Renderer
>>
spine()
Section titled “spine()”spine: (
props?
) =>Spine
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<SpineProps
>
Returns
Section titled “Returns”spineAnimation()
Section titled “spineAnimation()”spineAnimation: <
ANames
,A
>(props?
) =>SpineAnimation
<ANames
,A
>
Type Parameters
Section titled “Type Parameters”ANames
Section titled “ANames”ANames
extends string
= string
A
extends Application
<DataSchema
, ActionContext
, Action
, Renderer
> = Application
<DataSchema
, ActionContext
, Action
, Renderer
>
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<SpineProps
>
Returns
Section titled “Returns”SpineAnimation
<ANames
, A
>
sprite()
Section titled “sprite()”sprite: (
props?
) =>Sprite
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<SpriteProps
>
Returns
Section titled “Returns”Sprite
text()
Section titled “text()”text: (
props?
) =>Text
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<TextProps
>
Returns
Section titled “Returns”Text
texture()
Section titled “texture()”texture: (
props?
) =>Texture
=resolveTexture
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<TextureProps
>
Returns
Section titled “Returns”Texture
tilingSprite()
Section titled “tilingSprite()”tilingSprite: (
props?
) =>TilingSprite
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<TilingSpriteProps
>
Returns
Section titled “Returns”TilingSprite
toaster()
Section titled “toaster()”toaster: (
toasterConfig?
,defaultToastConfig
) =>Toaster
Parameters
Section titled “Parameters”toasterConfig?
Section titled “toasterConfig?”Partial
<ToasterConfig
>
defaultToastConfig?
Section titled “defaultToastConfig?”Partial
<ToastConfig
> = {}
Returns
Section titled “Returns”uiCanvas()
Section titled “uiCanvas()”uiCanvas: (
props?
) =>UICanvas
Parameters
Section titled “Parameters”props?
Section titled “props?”Partial
<UICanvasFactoryProps
>
Returns
Section titled “Returns”svg(
props
):Svg
Parameters
Section titled “Parameters”WithRequiredProps
<SvgProps
, "ctx"
>
Returns
Section titled “Returns”paused
Section titled “paused”Get Signature
Section titled “Get Signature”get paused():
boolean
Defined in: core/Application.ts:174
Indicates whether the application is currently paused.
Example
Section titled “Example”if (app.paused) { // Show pause menu}
Returns
Section titled “Returns”boolean
Indicates whether the application is currently paused.
Example
Section titled “Example”if (app.paused) { // Show pause menu}
Implementation of
Section titled “Implementation of”popups
Section titled “popups”Get Signature
Section titled “Get Signature”get popups():
IPopupManagerPlugin
Defined in: core/Application.ts:442
The PopupManagerPlugin instance for managing pop-up dialogs or views.
Example
Section titled “Example”app.popups.show('settingsPopup', { volume: 0.5 });
Returns
Section titled “Returns”The PopupManagerPlugin instance for managing pop-up dialogs or views.
Example
Section titled “Example”app.popups.show('settingsPopup', { volume: 0.5 });
Implementation of
Section titled “Implementation of”resizer
Section titled “resizer”Get Signature
Section titled “Get Signature”get resizer():
IResizerPlugin
Defined in: core/Application.ts:286
The ResizerPlugin instance for managing application resizing.
Returns
Section titled “Returns”The ResizerPlugin instance for managing application resizing.
Implementation of
Section titled “Implementation of”scenes
Section titled “scenes”Get Signature
Section titled “Get Signature”get scenes():
ISceneManagerPlugin
Defined in: core/Application.ts:410
The SceneManagerPlugin instance for managing game scenes. Handles scene transitions, loading, and lifecycle.
Example
Section titled “Example”app.scenes.load('level1');app.scenes.currentScene.pause();
Returns
Section titled “Returns”The SceneManagerPlugin instance for managing game scenes. Handles scene transitions, loading, and lifecycle.
Example
Section titled “Example”app.scenes.load('level1');app.scenes.currentScene.pause();
Implementation of
Section titled “Implementation of”signal
Section titled “signal”Get Signature
Section titled “Get Signature”get signal():
ICoreSignals
Defined in: core/Application.ts:525
Access to core application signals. These are global signals for important application events.
Example
Section titled “Example”app.signal.onLoadRequiredComplete.connectOnce(() => { console.log('Core assets loaded!');});
Returns
Section titled “Returns”Access to core application signals. These are global signals for important application events.
Example
Section titled “Example”app.signal.onLoadRequiredComplete.connectOnce(() => { console.log('Core assets loaded!');});
Implementation of
Section titled “Implementation of”signals
Section titled “signals”Get Signature
Section titled “Get Signature”get signals():
ICoreSignals
Defined in: core/Application.ts:529
Returns
Section titled “Returns”Get Signature
Section titled “Get Signature”get size():
Size
Defined in: core/Application.ts:438
The current size (width and height) of the application’s view/canvas. Managed by the ResizerPlugin.
Example
Section titled “Example”console.log(app.size.width, app.size.height);const aspectRatio = app.size.width / app.size.height;
Returns
Section titled “Returns”The current size (width and height) of the application’s view/canvas. Managed by the ResizerPlugin.
Example
Section titled “Example”console.log(app.size.width, app.size.height);const aspectRatio = app.size.width / app.size.height;
Implementation of
Section titled “Implementation of”Get Signature
Section titled “Get Signature”get store():
IStore
Defined in: core/Application.ts:366
The Store instance for managing application state. Uses a data schema and adapters for persistence.
Example
Section titled “Example”const currentScore = app.store.getState().score;app.store.updateState({ score: currentScore + 10 });
Returns
Section titled “Returns”The Store instance for managing application state. Uses a data schema and adapters for persistence.
Example
Section titled “Example”const currentScore = app.store.getState().score;app.store.updateState({ score: currentScore + 10 });
Implementation of
Section titled “Implementation of”timers
Section titled “timers”Get Signature
Section titled “Get Signature”get timers():
ITimerPlugin
Defined in: core/Application.ts:449
Returns
Section titled “Returns”voiceover
Section titled “voiceover”Get Signature
Section titled “Get Signature”get voiceover():
IVoiceOverPlugin
Defined in: core/Application.ts:471
Returns
Section titled “Returns”IVoiceOverPlugin
webEvents
Section titled “webEvents”Get Signature
Section titled “Get Signature”get webEvents():
IWebEventsPlugin
Defined in: core/Application.ts:417
The WebEventsPlugin instance for managing browser-related events. Handles events like window resize, visibility change, etc.
Example
Section titled “Example”app.webEvents.onResize.connect((newSize) => { console.log('Resized to:', newSize.width, newSize.height);});
Returns
Section titled “Returns”The WebEventsPlugin instance for managing browser-related events. Handles events like window resize, visibility change, etc.
Example
Section titled “Example”app.webEvents.onResize.connect((newSize) => { console.log('Resized to:', newSize.width, newSize.height);});
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”action()
Section titled “action()”action<
TActionData
>(action
,data?
):void
Defined in: core/Application.ts:770
Dispatches an action with optional data alias for sendAction
Type Parameters
Section titled “Type Parameters”TActionData
Section titled “TActionData”TActionData
= any
The type of data to send with the action
Parameters
Section titled “Parameters”action
Section titled “action”A
The action to dispatch
TActionData
Optional data to send with the action
Returns
Section titled “Returns”void
Example
Section titled “Example”// Send a 'jump' action with power dataapp.action('jump', { power: 100 });
Implementation of
Section titled “Implementation of”actions()
Section titled “actions()”actions<
TActionData
>(action
):ActionSignal
<TActionData
>
Defined in: core/Application.ts:743
Gets an ActionSignal for the specified action type
Type Parameters
Section titled “Type Parameters”TActionData
Section titled “TActionData”TActionData
= any
The type of data associated with the action
Parameters
Section titled “Parameters”action
Section titled “action”A
The action to get the signal for
Returns
Section titled “Returns”ActionSignal
<TActionData
>
A signal that can be used to listen for the action
Example
Section titled “Example”// Listen for a 'jump' actionapp.actions('jump').connect((data) => { player.jump(data.power);});
Implementation of
Section titled “Implementation of”addAnimation()
Section titled “addAnimation()”addAnimation(
animation
,contextId?
):Timeline
|Tween
| (Timeline
|Tween
)[]
Defined in: core/Application.ts:346
Adds one or more GSAP tweens or timelines to a specified animation context.
This uses the GSAPPlugin’s custom animation context (a Set of tweens/timelines),
not a gsap.Context
instance. If no contextId is provided, animations are added
to the plugin’s global collection.
Parameters
Section titled “Parameters”animation
Section titled “animation”A single GSAP tween/timeline or an array of them.
Timeline
| Tween
| (Timeline
| Tween
)[]
contextId?
Section titled “contextId?”string
Optional ID of the animation context. Defaults to the global context.
Returns
Section titled “Returns”Timeline
| Tween
| (Timeline
| Tween
)[]
The animation(s) that were added.
Implementation of
Section titled “Implementation of”destroy()
Section titled “destroy()”destroy(
rendererDestroyOptions?
,options?
):void
Defined in: core/Application.ts:570
Destroy the application This will destroy all plugins and the store
Parameters
Section titled “Parameters”rendererDestroyOptions?
Section titled “rendererDestroyOptions?”RendererDestroyOptions
options?
Section titled “options?”DestroyOptions
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”IApplication.destroy
Overrides
Section titled “Overrides”PIXIPApplication.destroy
eases()
Section titled “eases()”eases(
namesOnly
):string
[] |Ease
Defined in: core/Application.ts:358
Returns the registered eases or ease names.
Parameters
Section titled “Parameters”namesOnly
Section titled “namesOnly”boolean
= false
If true, returns only the ease names.
Returns
Section titled “Returns”string
[] | Ease
The registered eases or ease names.
Implementation of
Section titled “Implementation of”getAllPaths()
Section titled “getAllPaths()”getAllPaths():
string
[]
Defined in: core/Application.ts:399
Returns
Section titled “Returns”string
[]
getChildAtPath()
Section titled “getChildAtPath()”getChildAtPath(
path
):undefined
|Container
<ContainerChild
>
Defined in: core/Application.ts:383
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”undefined
| Container
<ContainerChild
>
getChildrenAtPaths()
Section titled “getChildrenAtPaths()”getChildrenAtPaths(…
paths
):Container
<ContainerChild
>[]
Defined in: core/Application.ts:391
Parameters
Section titled “Parameters”…string
[]
Returns
Section titled “Returns”Container
<ContainerChild
>[]
getPathForChild()
Section titled “getPathForChild()”getPathForChild(
container
):string
Defined in: core/Application.ts:387
Parameters
Section titled “Parameters”container
Section titled “container”Container
Returns
Section titled “Returns”string
getPathsForChildren()
Section titled “getPathsForChildren()”getPathsForChildren(…
containers
):string
[]
Defined in: core/Application.ts:395
Parameters
Section titled “Parameters”containers
Section titled “containers”…Container
<ContainerChild
>[]
Returns
Section titled “Returns”string
[]
getPlugin()
Section titled “getPlugin()”getPlugin<
T
>(pluginName
,debug
):T
Defined in: core/Application.ts:686
Retrieves a registered plugin by its name.
Type Parameters
Section titled “Type Parameters”T
extends IPlugin
<any
>
The expected type of the plugin.
Parameters
Section titled “Parameters”pluginName
Section titled “pluginName”string
boolean
= false
If true and the plugin is not found, an error will be logged. Defaults to false.
Returns
Section titled “Returns”T
The plugin instance if found, otherwise undefined (or T if type assertion is used).
Example
Section titled “Example”const myCustomPlugin = app.getPlugin<MyCustomPluginType>('myCustomPlugin');if (myCustomPlugin) { myCustomPlugin.doSomethingCool();}
const nonExistentPlugin = app.getPlugin('nonExistent', true); // Will log an error
Implementation of
Section titled “Implementation of”getStorageAdapter()
Section titled “getStorageAdapter()”getStorageAdapter(
adapterId
):IStorageAdapter
Defined in: core/Application.ts:793
Get a storage adapter by id
Parameters
Section titled “Parameters”adapterId
Section titled “adapterId”string
Returns
Section titled “Returns”getUnloadedPlugin()
Section titled “getUnloadedPlugin()”getUnloadedPlugin(
id
):undefined
|ImportListItem
<IPlugin
<any
>>
Defined in: core/Application.ts:712
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”undefined
| ImportListItem
<IPlugin
<any
>>
initialize()
Section titled “initialize()”initialize(
config
,el?
):Promise
<IApplication
<D
,C
,A
>>
Defined in: core/Application.ts:584
Initializes the application with the given configuration and attaches it to an HTML element. This is the main entry point for starting the application.
Parameters
Section titled “Parameters”config
Section titled “config”AppConfig
<D
>
The application configuration object.
HTMLElement
The HTML element to append the application’s canvas to. If not provided, an error will be thrown.
Returns
Section titled “Returns”Promise
<IApplication
<D
, C
, A
>>
A promise that resolves with the initialized application instance.
Example
Section titled “Example”const gameContainer = document.getElementById('game');if (gameContainer) { app.initialize({ appName: 'My Game' }, gameContainer) .then(initializedApp => { console.log(`${initializedApp.appName} initialized successfully!`); initializedApp.scenes.load('mainMenu'); }) .catch(error => console.error('Initialization failed:', error));} else { console.error('Game container element not found!');}
Implementation of
Section titled “Implementation of”isActionActive()
Section titled “isActionActive()”isActionActive(
action
):boolean
Defined in: core/Application.ts:784
Checks if an action is currently active
Parameters
Section titled “Parameters”action
Section titled “action”A
The action to check
Returns
Section titled “Returns”boolean
True if the action is active, false otherwise
Example
Section titled “Example”// Check if the 'run' action is activeif (app.isActionActive('run')) { player.updateSpeed(runningSpeed);}
Implementation of
Section titled “Implementation of”loadPlugin()
Section titled “loadPlugin()”loadPlugin(
listItem
,isDefault
):Promise
<void
>
Defined in: core/Application.ts:716
Parameters
Section titled “Parameters”listItem
Section titled “listItem”isDefault
Section titled “isDefault”boolean
= false
Returns
Section titled “Returns”Promise
<void
>
pause()
Section titled “pause()”pause(
config?
):void
Defined in: core/Application.ts:178
Pauses the application.
This can include pausing the ticker, animations, audio, and timers based on the PauseConfig
.
Parameters
Section titled “Parameters”config?
Section titled “config?”Partial
<PauseConfig
>
Optional configuration for what aspects of the application to pause.
Returns
Section titled “Returns”void
Example
Section titled “Example”// Pause everythingapp.pause();
// Only pause audio and timersapp.pause({ pauseAudio: true, pauseTimers: true });
Implementation of
Section titled “Implementation of”postInitialize()
Section titled “postInitialize()”postInitialize():
Promise
<void
>
Defined in: core/Application.ts:694
Runs any post-initialization setup tasks.
This is called after the main initialize
method has completed and core plugins are ready.
It’s a good place for plugins to finalize their setup or for the application to perform tasks
that depend on a fully initialized environment.
Returns
Section titled “Returns”Promise
<void
>
A promise that resolves when post-initialization tasks are complete.
Example
Section titled “Example”// Inside a custom Application class or after app.initialize resolvesasync function startMyGame() { await app.initialize(config, el); await app.postInitialize(); // Ensures everything is fully set up app.scenes.load('intro');}
Implementation of
Section titled “Implementation of”resume()
Section titled “resume()”resume():
void
Defined in: core/Application.ts:203
Resumes the application from a paused state. Restores the state of ticker, animations, audio, and timers that were paused.
Returns
Section titled “Returns”void
Example
Section titled “Example”app.resume();
Implementation of
Section titled “Implementation of”sendAction()
Section titled “sendAction()”sendAction<
TActionData
>(action
,data?
):void
Defined in: core/Application.ts:756
Dispatches an action with optional data
Type Parameters
Section titled “Type Parameters”TActionData
Section titled “TActionData”TActionData
= any
The type of data to send with the action
Parameters
Section titled “Parameters”action
Section titled “action”A
The action to dispatch
TActionData
Optional data to send with the action
Returns
Section titled “Returns”void
Example
Section titled “Example”// Send a 'jump' action with power dataapp.sendAction('jump', { power: 100 });
Implementation of
Section titled “Implementation of”setContainer()
Section titled “setContainer()”setContainer(
container
):void
Defined in: core/Application.ts:578
Sets the main HTML container element for the application. This is typically the element where the PixiJS canvas is appended.
Parameters
Section titled “Parameters”container
Section titled “container”HTMLElement
The HTMLElement to be used as the application container.
Returns
Section titled “Returns”void
Example
Section titled “Example”const newGameContainer = document.createElement('div');document.body.appendChild(newGameContainer);app.setContainer(newGameContainer); // If app needs to change its parent container
Implementation of
Section titled “Implementation of”setFullScreen()
Section titled “setFullScreen()”setFullScreen(
value
):void
Defined in: core/Application.ts:508
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
setFullScreenElement()
Section titled “setFullScreenElement()”setFullScreenElement(
value
):void
Defined in: core/Application.ts:504
Parameters
Section titled “Parameters”null
| HTMLElement
| Window
Returns
Section titled “Returns”void
toggleFullScreen()
Section titled “toggleFullScreen()”toggleFullScreen():
void
Defined in: core/Application.ts:512
Returns
Section titled “Returns”void
togglePause()
Section titled “togglePause()”togglePause(
config?
):void
Defined in: core/Application.ts:236
Parameters
Section titled “Parameters”config?
Section titled “config?”Partial
<PauseConfig
>
Returns
Section titled “Returns”void
getInstance()
Section titled “getInstance()”
static
getInstance<T
>():T
Defined in: core/Application.ts:560
Type Parameters
Section titled “Type Parameters”T
extends Application
<DataSchema
, ActionContext
, Action
, Renderer
> = Application
<DataSchema
, ActionContext
, Action
, Renderer
>
Returns
Section titled “Returns”T