Skip to content

Commit cfcc85a

Browse files
committed
JSFL: black shape export fix, zero alpha fix
1 parent b2315ad commit cfcc85a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

jsfl/ExportToPhaser.jsfl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ PhaserExporter.prototype.collectHitZoneParams = function(element, target, forSta
275275
*/
276276
PhaserExporter.prototype.collectShapeParams = function(element, target, forState) {
277277
var color;
278+
var isSolid = false;
278279
var alpha = 1;
279280
for (var contourIndex in element.contours) {
280281
var contour = element.contours[contourIndex];
@@ -291,13 +292,13 @@ PhaserExporter.prototype.collectShapeParams = function(element, target, forState
291292
return;
292293
} else if (contour.fill.style === 'solid') {
293294
color = parseInt(contour.fill.color.substr(1, 6), 16);
295+
isSolid = true;
294296
if (contour.fill.color.length > 7) {
295297
alpha = parseInt(contour.fill.color.substr(7, 2), 16);
296298
}
297299
}
298300
}
299-
if (!color) {
300-
//extractObject(element);
301+
if (!isSolid) {
301302
return;
302303
}
303304
if (alpha !== 1) {
@@ -393,7 +394,7 @@ PhaserExporter.prototype.collectCommonElementParams = function(element, target)
393394
target.scaleX *= -1;
394395
}
395396

396-
if (element.colorAlphaPercent && element.colorAlphaPercent !== 100)
397+
if (element.colorAlphaPercent !== undefined && element.colorAlphaPercent !== 100)
397398
target.alpha = element.colorAlphaPercent / 100;
398399
if (element.rotation) target.angle = element.rotation;
399400
};

0 commit comments

Comments
 (0)