MCPcopy Index your code
hub / github.com/SpringRoll/SpringRoll / constructor

Method constructor

src/Application.js:93–311  ·  view source on GitHub ↗

* @param {object} [config={}] Root configuration object for various internal Application objects * @param {object} [config.hintPlayer = HintSequencePlayer] IHintPlayer application will use. * @param {object} [config.features={}] A configuration object denoting which features are enabled for t

({ features, hintPlayer = new HintSequencePlayer() } = {})

Source from the content-addressed store, hash-verified

91 *
92 */
93 constructor({ features, hintPlayer = new HintSequencePlayer() } = {}) {
94 this.state = {
95 ready: new Property(false),
96 playOptions: new Property({}),
97 [pause]: new Property(undefined),
98 [captionsMuted]: new Property(undefined),
99 [captionsStyles]: new Property(undefined),
100 [soundVolume]: new Property(undefined),
101 [musicVolume]: new Property(undefined),
102 [voVolume]: new Property(undefined),
103 [sfxVolume]: new Property(undefined),
104 [pointerSize]: new Property(undefined),
105 [controlSensitivity]: new Property(undefined),
106 [buttonSize]: new Property(undefined),
107 [removableLayers]: new Property(undefined),
108 [hudPosition]: new Property(undefined),
109 [hitAreaScale]: new Property(undefined),
110 [dragThresholdScale]: new Property(undefined),
111 [health]: new Property(undefined),
112 [objectCount]: new Property(undefined),
113 [completionPercentage]: new Property(undefined),
114 [speedScale]: new Property(undefined),
115 [timersScale]: new Property(undefined),
116 [inputCount]: new Property(undefined),
117 [keyBinding]: new Property(undefined),
118 [colorVision]: new Property(undefined),
119 [fullScreen]: new Property(undefined),
120 };
121
122 this.stateDefaults = {
123 [pause]: false,
124 [captionsMuted]: true,
125 [captionsStyles]: {
126 color: '#FFFFFF',
127 edge: 'none',
128 font: 'arial',
129 background: '#000000',
130 size: 'md',
131 align: 'top'
132 },
133 [soundVolume]: 1,
134 [musicVolume]: 1,
135 [voVolume]: 1,
136 [sfxVolume]: 1,
137 [pointerSize]: 0.5,
138 [controlSensitivity]: 0.5,
139 [buttonSize]: 0.5,
140 [removableLayers]: 0,
141 [hudPosition]: '',
142 [hitAreaScale]: 0.5,
143 [dragThresholdScale]: 0.5,
144 [health]: 0.5,
145 [objectCount]: 0.5,
146 [completionPercentage]: 0.5,
147 [speedScale]: 0.5,
148 [timersScale]: 0.5,
149 [inputCount]: 0.5,
150 [keyBinding]: {},

Callers

nothing calls this directly

Calls 5

setupPluginsMethod · 0.95
validateListenersMethod · 0.95
setStateDefaultsMethod · 0.95
logMethod · 0.80
playMethod · 0.80

Tested by

no test coverage detected