Skip to content

Commit 477cde3

Browse files
committed
New WebGL Renderer events
1 parent 080677f commit 477cde3

5 files changed

Lines changed: 90 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2020 Photon Storm Ltd.
4+
* @license {@link https://opensource.org/licenses/MIT|MIT License}
5+
*/
6+
7+
/**
8+
* The Post-Render Event.
9+
*
10+
* This event is dispatched by the WebGL Renderer when all rendering, for all cameras in all Scenes,
11+
* has completed.
12+
*
13+
* @event Phaser.Renderer.WebGL.Events#POST_RENDER
14+
* @since 3.50.0
15+
*/
16+
module.exports = 'postrender';
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 2020 Photon Storm Ltd.
4+
* @license {@link https://opensource.org/licenses/MIT|MIT License}
5+
*/
6+
7+
/**
8+
* The Pre-Render Event.
9+
*
10+
* This event is dispatched by the WebGL Renderer. This happens right at the start of the render
11+
* process, after the context has been cleared, the scissors enabled and everything has been
12+
* reset ready for the render.
13+
*
14+
* @event Phaser.Renderer.WebGL.Events#PRE_RENDER
15+
* @since 3.50.0
16+
*/
17+
module.exports = 'prerender';
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2020 Photon Storm Ltd.
4+
* @license {@link https://opensource.org/licenses/MIT|MIT License}
5+
*/
6+
7+
/**
8+
* The Render Event.
9+
*
10+
* This event is dispatched by the WebGL Renderer for every camera in every Scene.
11+
*
12+
* It is dispatched before any of the children in the Scene have been rendered.
13+
*
14+
* @event Phaser.Renderer.WebGL.Events#RENDER
15+
* @since 3.50.0
16+
*
17+
* @param {Phaser.Scene} scene - The Scene being rendered.
18+
* @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered.
19+
*/
20+
module.exports = 'render';
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2020 Photon Storm Ltd.
4+
* @license {@link https://opensource.org/licenses/MIT|MIT License}
5+
*/
6+
7+
/**
8+
* The Renderer Resize Event.
9+
*
10+
* This event is dispatched by the WebGL Renderer when it is resized, usually as a result
11+
* of the Scale Manager resizing.
12+
*
13+
* @event Phaser.Renderer.WebGL.Events#RESIZE
14+
* @since 3.50.0
15+
*
16+
* @param {number} width - The new width of the renderer.
17+
* @param {number} height - The new height of the renderer.
18+
*/
19+
module.exports = 'resize';

src/renderer/webgl/events/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2020 Photon Storm Ltd.
4+
* @license {@link https://opensource.org/licenses/MIT|MIT License}
5+
*/
6+
7+
/**
8+
* @namespace Phaser.Renderer.WebGL.Events
9+
*/
10+
11+
module.exports = {
12+
13+
POST_RENDER: require('./POST_RENDER_EVENT'),
14+
PRE_RENDER: require('./PRE_RENDER_EVENT'),
15+
RENDER: require('./RENDER_EVENT'),
16+
RESIZE: require('./RESIZE_EVENT')
17+
18+
};

0 commit comments

Comments
 (0)