Skip to content

Commit 339b4fd

Browse files
committed
Added setTime method
1 parent d0da336 commit 339b4fd

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/renderer/webgl/WebGLPipeline.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,6 +1341,25 @@ var WebGLPipeline = new Class({
13411341
return this.bindTexture(target.texture, unit);
13421342
},
13431343

1344+
/**
1345+
* Sets the current duration into a 1f uniform value based on the given name.
1346+
*
1347+
* This can be used for mapping time uniform values, such as `iTime`.
1348+
*
1349+
* @method Phaser.Renderer.WebGL.WebGLPipeline#setTime
1350+
* @since 3.50.0
1351+
*
1352+
* @param {string} name - The name of the uniform to set.
1353+
*
1354+
* @return {this} This WebGLPipeline instance.
1355+
*/
1356+
setTime: function (uniform)
1357+
{
1358+
this.set1f(uniform, this.game.loop.getDuration());
1359+
1360+
return this;
1361+
},
1362+
13441363
/**
13451364
* Sets a 1f uniform value based on the given name on the currently set shader.
13461365
*

0 commit comments

Comments
 (0)