Application
Main Application class.
Extends
Application
Type parameters
• T extends Application
= any
Constructors
new Application()
new Application<
T
>(appConfig
?):Application
<T
>
The config passed in can be a json object, or an AppConfig
object.
Parameters
• appConfig?: Partial
<DillPixelApplicationOptions
> & object
Returns
Application
<T
>
Overrides
PIXIApplication.constructor
See
AppConfig
for what can be contained in the passed-in config.
Default
Default
Default
Default
Default
Default
Default
Source
Accessors
add
get
add():Add
Returns
Source
addToStage
get
addToStage(): <U
>(…children
) =>U
[0
]
Returns
Function
Adds one or more children to the container.
Multiple items can be added like so: myContainer.addChild(thingOne, thingTwo, thingThree)
Type parameters
• U extends DisplayObject
[]
Parameters
• …children: U
The DisplayObject(s) to add to the container
Returns
U
[0
]
- The first child that was added.
Source
audio
get
audio():IAudioManager
Returns
Source
copy
get
copy():CopyManager
Returns
Source
defaultState
get
defaultState():undefined
|string
| typeofState
Returns
undefined
| string
| typeof State
Source
hitAreaRenderer
get
hitAreaRenderer():HitAreaRenderer
Returns
Source
htmlTextStyles
get
htmlTextStyles(): typeofHTMLTextStyleManager
Returns
typeof HTMLTextStyleManager
Source
keyboard
get
keyboard():KeyboardManager
Returns
Source
load
get
load():LoadManager
Returns
Source
make
get
make(): typeofMake
Returns
typeof Make
Source
orientationManager
get
orientationManager():OrientationManager
Returns
Source
physics
get
physics():PhysicsBase
Returns
Source
popups
get
popups():PopupManager
<T
>
Returns
PopupManager
<T
>
Source
requiredAssets
get
requiredAssets():AssetMapData
[]
Override to specify assets that should persist between state loads.
Note: Splash screen assets are loaded before requiredAssets
Returns
Source
resizeOptions
set
resizeOptions(value
):void
Parameters
• value: Partial
<ResizeManagerOptions
>
Source
resizer
get
resizer():IResizeManager
Returns
IResizeManager
Source
resolutionSuffix
get
resolutionSuffix():string
Returns
string
Source
saveManager
get
saveManager():SaveManager
Returns
Source
screenSize
get
screenSize():Point
Returns
Point
Source
signals
get
signals(): typeofSignals
Returns
typeof Signals
Source
size
get
size():Point
Returns
Point
Source
state
get
state():StateManager
<T
>
Returns
StateManager
<T
>
Source
voiceover
get
voiceover():IVoiceOverManager
Returns
Source
webEvents
get
webEvents():WebEventsManager
Returns
Source
containerElement
get
static
containerElement():undefined
|HTMLElement
Returns
undefined
| HTMLElement
Source
containerID
get
static
containerID():string
Returns
string
Source
instance
get
static
instance():Application
<any
>
gets the current singleton instance
Returns
Application
<any
>
Source
Methods
addAssetGroup()
addAssetGroup(
groupIdOrClass
,assets
?):void
proxy function for
Parameters
• groupIdOrClass: string
| typeof State
| typeof State
• assets?: AssetMapData
[]
Returns
void
Link
Source
addPhysics()
addPhysics(
type
):Promise
<PhysicsBase
>
Parameters
• type: PhysicsEngineType
= PhysicsEngineType.MATTER
Returns
Promise
<PhysicsBase
>
Source
addStats()
addStats():
Promise
<void
>
Returns
Promise
<void
>
Source
hasAsset()
hasAsset(
pAssetName
):boolean
Parameters
• pAssetName: string
Returns
boolean
Source
init()
init():
Promise
<void
>
Initializes all managers and starts the splash screen process.
Returns
Promise
<void
>
Source
initialize()
initialize():
Promise
<void
>
Returns
Promise
<void
>
Source
listFonts()
listFonts():
FontFace
[]
Returns
FontFace
[]
Source
loadDocumentFonts()
loadDocumentFonts():
Promise
<void
>
Returns
Promise
<void
>
Source
loadHTMLTextStyles()
loadHTMLTextStyles():
Promise
<void
>
Preload any custom font styles to be used later on with html text currently not sure if there’s a better way to do this…
Returns
Promise
<void
>
See
- https://github.com/pixijs/html-text/pull/30
- for functionality
Async
Example
Source
playVO()
playVO(
key
,mode
?,callback
?):void
Plays a voiceover. Override to e.g. add clauses to playback
Parameters
• key: string
| (string
| number
)[]
• mode?: PlayMode
| Callback
| Partial
<IPlayOptions
>
• callback?: Callback
Returns
void
Source
createContainer()
static
createContainer(pId
):HTMLDivElement
Creates a container element with the given id and appends it to the DOM.
Parameters
• pId: string
Returns
HTMLDivElement
Source
getInstance()
static
getInstance<T
>():T
Creates a new instance of the Application class and returns it.
Type parameters
• T extends Application
<any
> = Application
<any
>
Returns
T