Skip to content

Commit 3a1a9ea

Browse files
committed
If you set transparent in the Game Config but didn't provide a backgroundColor then it would render as black. It will now be properly transparent. If you do provide a color value then it must include an alpha component.
1 parent a89be7a commit 3a1a9ea

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/boot/Config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,15 @@ var Config = new Class({
186186
this.roundPixels = GetValue(config, 'roundPixels', false);
187187
this.transparent = GetValue(config, 'transparent', false);
188188
this.clearBeforeRender = GetValue(config, 'clearBeforeRender', true);
189-
this.backgroundColor = ValueToColor(GetValue(config, 'backgroundColor', 0));
189+
190+
var bgc = GetValue(config, 'backgroundColor', 0);
191+
192+
this.backgroundColor = ValueToColor(bgc);
193+
194+
if (bgc === 0 && this.transparent)
195+
{
196+
this.backgroundColor.alpha = 0;
197+
}
190198

191199
// Callbacks
192200
this.preBoot = GetValue(config, 'callbacks.preBoot', NOOP);

0 commit comments

Comments
 (0)