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 Fooshi

Hello,
I have integrate the button plugin of Philip that i have found here https://gist.github.com/1395616
To display a button i works fine but the event pressed or pressedUp seems not be working for me.
I have loaded my entity in the init function of my game like this :

btn_valider	= ig.game.spawnEntity(button,100,430, {
				 size		: {x:138, y:36},    
	  			 animSheet	: new ig.AnimationSheet('media/btn-valider.png', 138, 36),
				 pressedUp	: function(){
					 console.log('la');
				 }
			});

Thank you for some help

EDIT : I have resolved my problem

1 decade ago by phoxer

Hi @Fooshi, I have the same issue, how did you resolved it? Thanks

1 decade ago by Fooshi

In the update function of the Entity of the button (in the button.js files) i have added this line :
var _clicked = ig.input.state('scratch');

scratch is the name of the listener of the mouse i have initialised in the init function of my game like this :
ig.input.bind(ig.KEY.MOUSE1, 'scratch');	

Hope i have help you
Page 1 of 1
« first « previous next › last »