Skip to content

Commit 41bcaba

Browse files
committed
Dynamic BitmapText now uses origin component to render the text.
1 parent 9654068 commit 41bcaba

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/gameobjects/bitmaptext/static/BitmapTextCanvasRenderer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ var BitmapTextCanvasRenderer = function (renderer, src, interpolationPercentage,
8787
ctx.save();
8888
ctx.translate((src.x - cameraScrollX) + src.frame.x, (src.y - cameraScrollY) + src.frame.y);
8989
ctx.rotate(src.rotation);
90+
ctx.translate(-src.displayOriginX, -src.displayOriginY);
9091
ctx.scale(src.scaleX, src.scaleY);
9192

9293
// ctx.fillStyle = 'rgba(255,0,255,0.5)';

src/renderer/webgl/pipelines/TextureTintPipeline.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,9 @@ var TextureTintPipeline = new Class({
983983
continue;
984984
}
985985

986+
x -= bitmapText.displayOriginX;
987+
y -= bitmapText.displayOriginY;
988+
986989
xw = x + glyphW * scale;
987990
yh = y + glyphH * scale;
988991
tx0 = x * mva + y * mvc + mve;

0 commit comments

Comments
 (0)