HI!
I think that i try everything, but it no work as i planned.
In my case i have Object and some listeners: onMouseIn and on MouseOut I want that sprite be semi-semi-transparent on hover (.25) and then again non-transparent on mouseOut.(I greatly simplified, because in my example there is a tile on which there are objects that I want to make translucent when you hover the mouse on the tiles)
First i try:
b.onMouseIn = function() {
this.getSprite(0).setDrawModifiers([{type: 'alpha', alpha: .2}]);
}
b.onMouseOut = function() {
this.getSprite(0).setDrawModifiers([{type: 'alpha', alpha: 1}]);
}
also i try:
b.onMouseOut = function() {
this.getSprite(0).setDrawModifiers([]);
}
some problems with onMouse listeners if litle lags detected and this construct do sprite alpha = .2 but not 1 on mouseOut
Then i try:
b.onMouseIn = function() { this.getSprite().setDrawFunction(wade.drawFunctions.alpha_(1,this.getSprite().draw));
}
b.onMouseOut = function() {
this.getSprite().setDrawFunction(wade.drawFunctions.alpha_(1,this.getSprite().draw));
}
same effect - sprites set semi-transparent and not back to alpha=1 again
Then i try with Path:
b.onMouseIn = function() {
this.setPath(wade.getPath('fade-out'),0,1);
}
b.onMouseOut = function() {
this.setPath(wade.getPath('fade-in'),0,1);
}
But it call some laggy when i move mouse on my gamescreen...
Please help. It seems easy, but i broke my brain ;)