10 years ago by Daryl
Hey guys,
I'm quite new to ImpactJs and really like how the engine is built. Ive gotten to a bit of a problem however.
When trying to bind the left mouse key to an input in main.js it doesnt work but right key does.
init: function() {
..
ig.input.bind(ig.KEY.MOUSE1, 'leftclick');
ig.input.bind(ig.KEY.MOUSE2, 'click');
..
}
update: function() {
..
if(ig.input.pressed('click')) {console.log('right click')}
if(ig.input.pressed('leftclick')) {console.log('left click');}
..
}
Am I doing anything wrong? Any help would be appreciated!
I'm quite new to ImpactJs and really like how the engine is built. Ive gotten to a bit of a problem however.
When trying to bind the left mouse key to an input in main.js it doesnt work but right key does.
init: function() {
..
ig.input.bind(ig.KEY.MOUSE1, 'leftclick');
ig.input.bind(ig.KEY.MOUSE2, 'click');
..
}
update: function() {
..
if(ig.input.pressed('click')) {console.log('right click')}
if(ig.input.pressed('leftclick')) {console.log('left click');}
..
}
Am I doing anything wrong? Any help would be appreciated!