Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by dkollmann

I am currently trying to hide a layer in the game which does not seem to work by just changing its visibility. What would be the easiest way to do this?

1 decade ago by Jesse

You can't do it in the editor. Once you save, any layer you hid will not remain hidden in the level when the game's run.

Have the game run this code once:

ig.BackgroundMap.inject({
	
	visible: true,
	
	draw: function() {
		if (!this.visible) {
			return;
		}
		this.parent();
	}

});

Using a reference to the background map object (from the ig.game.backgroundMaps array) just turn visible off.

bg.visible = false;

1 decade ago by stahlmanDesign

Thanks this old thread was really helpful. Works great.
Page 1 of 1
« first « previous next › last »