mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 05:33:35 +00:00
Fixed order of transformation for dynamic bitmap text
This commit is contained in:
parent
dbafd9a70c
commit
f3e0ae8d44
1 changed files with 21 additions and 15 deletions
|
@ -1403,15 +1403,15 @@ var TextureTintPipeline = new Class({
|
|||
var lastCharCode = 0;
|
||||
var translateX = srcX + frame.x;
|
||||
var translateY = srcY + frame.y;
|
||||
var rotation = -bitmapText.rotation;
|
||||
var rotation = bitmapText.rotation;
|
||||
var scaleX = bitmapText.scaleX;
|
||||
var scaleY = bitmapText.scaleY;
|
||||
var letterSpacing = bitmapText.letterSpacing;
|
||||
var sr = Math.sin(rotation);
|
||||
var cr = Math.cos(rotation);
|
||||
var sra = cr * scaleX;
|
||||
var srb = -sr * scaleX;
|
||||
var src = sr * scaleY;
|
||||
var srb = sr * scaleX;
|
||||
var src = -sr * scaleY;
|
||||
var srd = cr * scaleY;
|
||||
var sre = translateX;
|
||||
var srf = translateY;
|
||||
|
@ -1434,12 +1434,17 @@ var TextureTintPipeline = new Class({
|
|||
var pmd = parentMatrix[3];
|
||||
var pme = parentMatrix[4];
|
||||
var pmf = parentMatrix[5];
|
||||
var pca = cma * pma + cmb * pmc;
|
||||
var pcb = cma * pmb + cmb * pmd;
|
||||
var pcc = cmc * pma + cmd * pmc;
|
||||
var pcd = cmc * pmb + cmd * pmd;
|
||||
var pce = cme * pma + cmf * pmc + pme;
|
||||
var pcf = cme * pmb + cmf * pmd + pmf;
|
||||
var cse = -cameraScrollX;
|
||||
var csf = -cameraScrollY;
|
||||
var pse = cse * cma + csf * cmc + cme;
|
||||
var psf = cse * cmb + csf * cmd + cmf;
|
||||
var pca = pma * cma + pmb * cmc;
|
||||
var pcb = pma * cmb + pmb * cmd;
|
||||
var pcc = pmc * cma + pmd * cmc;
|
||||
var pcd = pmc * cmb + pmd * cmd;
|
||||
var pce = pme * cma + pmf * cmc + pse;
|
||||
var pcf = pme * cmb + pmf * cmd + psf;
|
||||
|
||||
mva = sra * pca + srb * pcc;
|
||||
mvb = sra * pcb + srb * pcd;
|
||||
mvc = src * pca + srd * pcc;
|
||||
|
@ -1449,6 +1454,9 @@ var TextureTintPipeline = new Class({
|
|||
}
|
||||
else
|
||||
{
|
||||
sre -= cameraScrollX;
|
||||
srf -= cameraScrollY;
|
||||
|
||||
mva = sra * cma + srb * cmc;
|
||||
mvb = sra * cmb + srb * cmd;
|
||||
mvc = src * cma + srd * cmc;
|
||||
|
@ -1567,14 +1575,12 @@ var TextureTintPipeline = new Class({
|
|||
y -= bitmapText.displayOriginY;
|
||||
x *= scale;
|
||||
y *= scale;
|
||||
x -= cameraScrollX;
|
||||
y -= cameraScrollY;
|
||||
|
||||
sr = Math.sin(-rotation);
|
||||
cr = Math.cos(-rotation);
|
||||
sr = Math.sin(rotation);
|
||||
cr = Math.cos(rotation);
|
||||
uta = cr * scale;
|
||||
utb = -sr * scale;
|
||||
utc = sr * scale;
|
||||
utb = sr * scale;
|
||||
utc = -sr * scale;
|
||||
utd = cr * scale;
|
||||
ute = x;
|
||||
utf = y;
|
||||
|
|
Loading…
Reference in a new issue