1 decade ago by Fooshi
Hello,
I have loaded one entity on the ig.game init and i want to chnage the alpha of each pixel pressed by the mouse to discover the background.
how i can do that ?
there is my code :
Thank you
I have loaded one entity on the ig.game init and i want to chnage the alpha of each pixel pressed by the mouse to discover the background.
how i can do that ?
there is my code :
TotemGame = ig.Game.extend({ first : null, clearColor : '#FFFFFF', white : new ig.Image('media/white.png'), euro1 : new ig.Image('media/euro1.png'), init : function(){ ig.input.bind(ig.KEY.MOUSE1, 'scratch'); // Ecouteur de la souris this.white.draw(0,0); this.euro1.draw(0,0); this.first = this.spawnEntity(FirstEntity,160,240); }, update : function(){ if(ig.input.state('scratch')) { console.log('X :'+ig.input.mouse.x+' Y :'+ig.input.mouse.y); } } }); ig.main('#canvas', TotemGame, 60, 320, 480, 1);
Thank you