Jump to content

problem with inputEnableChildren method


Trusiaczek
 Share

Recommended Posts

Hello,

I'd like to know, how i might to set inputEnableChildren flag to false - make it work?

i read on the internet, that the "inputEnableChildren" method must be validate before we used to "add" method, but there is no another way to change this flag on false after this? 

Or Is any alternative easiest way to dynamic disable click mouse event?

var sourceState = {
	
	
	create: function() 
	{
		game.physics.startSystem(Phaser.Physics.P2JS);
		

		this.reactContainer = game.add.group();
		sourceState.reactContainer.inputEnableChildren = true;
		
		
		for(let i =0; i<9; i++)
			this.rect = this.reactContainer.create(i*20, i*30, 'rect_normal');
		
		this.reactContainer.onChildInputDown.add(sourceState.fill, this);
		

	},

	update: function() 
	{
		
	},
	
	fill: function(rect)
	{
		
		if(sourceState.playerMoves >= 2)
		{
			sourceState.reactContainer.inputEnableChildren = false;
			console.log("heo");
		}
		
		sourceState.playerMoves++;
		rect.tint = 0x68B67F;
		
		
	},

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...