Skip to content

Commit 27b6c25

Browse files
committed
JSFL: shape alpha fix, removed useless polygon and tileSprite state params
1 parent 2fc7952 commit 27b6c25

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

jsfl/ExportToPhaser.jsfl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ PhaserExporter.prototype.collectShapeParams = function(element, target, forState
283283
continue;
284284
}
285285
if (contour.fill.style === 'bitmap') {
286+
if (forState) {
287+
return; // TODO update tileSprite scale?
288+
}
286289
target.type = 'tileSprite';
287290
target.width = element.width;
288291
target.height = element.height;
@@ -294,7 +297,7 @@ PhaserExporter.prototype.collectShapeParams = function(element, target, forState
294297
color = parseInt(contour.fill.color.substr(1, 6), 16);
295298
isSolid = true;
296299
if (contour.fill.color.length > 7) {
297-
alpha = parseInt(contour.fill.color.substr(7, 2), 16);
300+
alpha = roundToFract2(parseInt(contour.fill.color.substr(7, 2), 16) / 256);
298301
}
299302
}
300303
}
@@ -304,6 +307,9 @@ PhaserExporter.prototype.collectShapeParams = function(element, target, forState
304307
if (alpha !== 1) {
305308
target.alpha = alpha;
306309
}
310+
if (forState) {
311+
return;
312+
}
307313
target.color = color;
308314
target.type = 'polygon';
309315

0 commit comments

Comments
 (0)