Skip to content

Commit 131d1fe

Browse files
committed
Fix layers not properly hidden in HTML5 games.
Started implementing unit tests for GDJS.
1 parent 3206263 commit 131d1fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+80
-16190
lines changed

.gitignore

+6-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
/Binaries/.embuild
1717
/Binaries/.embuild-debug
1818
/Binaries/Releases/*.exe
19-
/Binaries/Releases/*.7z
20-
/Binaries/Releases/*.tar.bz2
21-
/Binaries/Releases/*.tar.lzma
22-
/Binaries/Releases/*.zip
19+
/Binaries/Releases/**/*.7z
20+
/Binaries/Releases/**/*.tar.bz2
21+
/Binaries/Releases/**/*.tar.lzma
22+
/Binaries/Releases/**/*.zip
23+
/Binaries/Releases/**/*.deb
2324
/WebIDE
2425
*.depend
2526
*.layout
@@ -50,3 +51,4 @@
5051
/Binaries/Output/WebIDE/libGD.raw.js
5152
/WebIDE
5253
!/GDCpp/scripts/bcp.exe
54+
/GDJS/tests/node_modules

GDJS/Runtime/layer.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
* @namespace gdjs
1919
* @constructor
2020
*/
21-
gdjs.Layer = function(name, runtimeScene)
21+
gdjs.Layer = function(layerData, runtimeScene)
2222
{
23-
this._name = name;
23+
this._name = layerData.name;
2424
this._cameraRotation = 0;
2525
this._zoomFactor = 1;
26-
this._hidden = false;
26+
this._hidden = !layerData.visibility;
2727
this._pixiRenderer = runtimeScene.getPIXIRenderer();
2828
this._pixiContainer = new PIXI.DisplayObjectContainer(); //The container of the layer
2929
this._cameraX = runtimeScene.getGame().getDefaultWidth()/2;
@@ -32,6 +32,7 @@ gdjs.Layer = function(name, runtimeScene)
3232
this._defaultHeight = runtimeScene.getGame().getDefaultHeight();
3333

3434
runtimeScene.getPIXIContainer().addChild(this._pixiContainer);
35+
this.show(!this._hidden);
3536
};
3637

3738
/**

0 commit comments

Comments
 (0)