Skip to content

Commit 9585a1c

Browse files
committed
Fixed issue of render texture only rendering the first frame. It should've read the cut properties
1 parent e0a4577 commit 9585a1c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/gameobjects/rendertexture/RenderTextureCanvas.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var RenderTextureCanvas = {
2323

2424
this.context.globalAlpha = this.globalAlpha;
2525
this.context.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
26-
this.context.drawImage(texture.source[frame.sourceIndex].image, frame.x, frame.y, frame.width, frame.height, x, y, frame.width, frame.height);
26+
this.context.drawImage(texture.source[frame.sourceIndex].image, frame.cutX, frame.cutY, frame.cutWidth, frame.cutHeight, x, y, frame.cutWidth, frame.cutWidth);
2727

2828
return this;
2929
}

src/gameobjects/rendertexture/RenderTextureWebGL.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var RenderTextureWebGL = {
2929
var glTexture = texture.source[frame.sourceIndex].glTexture;
3030
var tint = (this.globalTint >> 16) + (this.globalTint & 0xff00) + ((this.globalTint & 0xff) << 16);
3131
this.renderer.setFramebuffer(this.framebuffer);
32-
this.renderer.pipelines.TextureTintPipeline.drawTexture(glTexture, x, y, tint, this.globalAlpha, frame.x, frame.y, frame.width, frame.height, this.currentMatrix);
32+
this.renderer.pipelines.TextureTintPipeline.drawTexture(glTexture, x, y, tint, this.globalAlpha, frame.cutX, frame.cutY, frame.cutWidth, frame.cutHeight, this.currentMatrix);
3333
this.renderer.setFramebuffer(null);
3434
return this;
3535
}

0 commit comments

Comments
 (0)