Skip to content

Commit b5662db

Browse files
committed
New context lost / restored events
1 parent ea2365a commit b5662db

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2019 Photon Storm Ltd.
4+
* @license {@link https://opensource.org/licenses/MIT|MIT License}
5+
*/
6+
7+
/**
8+
* The Game Context Lost Event.
9+
*
10+
* This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Lost event from the browser.
11+
*
12+
* The partner event is `CONTEXT_RESTORED`.
13+
*
14+
* @event Phaser.Core.Events#CONTEXT_LOST
15+
* @since 3.19.0
16+
*/
17+
module.exports = 'contextlost';
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2019 Photon Storm Ltd.
4+
* @license {@link https://opensource.org/licenses/MIT|MIT License}
5+
*/
6+
7+
/**
8+
* The Game Context Restored Event.
9+
*
10+
* This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Restored event from the browser.
11+
*
12+
* The partner event is `CONTEXT_LOST`.
13+
*
14+
* @event Phaser.Core.Events#CONTEXT_RESTORED
15+
* @since 3.19.0
16+
*/
17+
module.exports = 'contextrestored';

src/core/events/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ module.exports = {
1212

1313
BLUR: require('./BLUR_EVENT'),
1414
BOOT: require('./BOOT_EVENT'),
15+
CONTEXT_LOST: require('./CONTEXT_LOST_EVENT'),
16+
CONTEXT_RESTORED: require('./CONTEXT_RESTORED_EVENT'),
1517
DESTROY: require('./DESTROY_EVENT'),
1618
FOCUS: require('./FOCUS_EVENT'),
1719
HIDDEN: require('./HIDDEN_EVENT'),

0 commit comments

Comments
 (0)