Skip to content

Commit f1fe131

Browse files
committed
Tidying up Render Texture to make it more useful
1 parent 622fd7c commit f1fe131

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818

1919
* The DataManager `changedata` event was emitting the original value of the data instead of new value (thanks @iamchristopher)
2020
* The LoaderPlugin didn't emit the `filecomplete` event if any of files failed to load, causing it to fail to run the Scene `create` function as well. Fix #3750 (thanks @NokFrt)
21+
* Fix setter calls in BuildGameObjectAnimation so it will now properly set the delay, repeat, repeat delay and yoyo of a config based animation (thanks @DannyT)
2122

2223
### Examples, Documentation and TypeScript
2324

2425
My thanks to the following for helping with the Phaser 3 Examples, Docs and TypeScript definitions, either by reporting errors, fixing them or helping author the docs:
2526

26-
@DannyT @squilibob @dvdbrink @t1gu1
27+
@DannyT @squilibob @dvdbrink @t1gu1 @cyantree @DrevanTonder
2728

2829
Also, a special mention to @andygroff for his excellent work enhancing the search box on the examples site.
2930

src/gameobjects/rendertexture/RenderTextureWebGL.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,21 @@ var RenderTextureWebGL = {
2727
draw: function (texture, frame, x, y)
2828
{
2929
var glTexture = texture.source[frame.sourceIndex].glTexture;
30+
3031
var tint = (this.globalTint >> 16) + (this.globalTint & 0xff00) + ((this.globalTint & 0xff) << 16);
32+
3133
this.renderer.setFramebuffer(this.framebuffer);
32-
this.renderer.pipelines.TextureTintPipeline.projOrtho(0, this.renderer.pipelines.TextureTintPipeline.width, 0, this.renderer.pipelines.TextureTintPipeline.height, -1000.0, 1000.0);
33-
this.renderer.pipelines.TextureTintPipeline.drawTexture(glTexture, x, y, tint, this.globalAlpha, frame.cutX, frame.cutY, frame.cutWidth, frame.cutHeight, this.currentMatrix, null, this);
34+
35+
var ttp = this.renderer.pipelines.TextureTintPipeline;
36+
37+
ttp.projOrtho(0, ttp.width, 0, ttp.height, -1000.0, 1000.0);
38+
39+
ttp.drawTexture(glTexture, x, y, tint, this.globalAlpha, frame.cutX, frame.cutY, frame.cutWidth, frame.cutHeight, this.currentMatrix, null, this);
40+
3441
this.renderer.setFramebuffer(null);
35-
this.renderer.pipelines.TextureTintPipeline.projOrtho(0, this.renderer.pipelines.TextureTintPipeline.width, this.renderer.pipelines.TextureTintPipeline.height, 0, -1000.0, 1000.0);
42+
43+
ttp.projOrtho(0, ttp.width, ttp.height, 0, -1000.0, 1000.0);
44+
3645
return this;
3746
}
3847

0 commit comments

Comments
 (0)