Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: mRax on March 09, 2007, 02:31:50 PM
-
Hello! :) I need in a little advice. The trouble is in playing sound, when mouse pointer is become on button (or, equally, when WME automatically use back_hover image for button).
I didn't find any window events in documentation, so I'm thinking about solution in entities now, i.e.
var lst=NULL;
while(TRUE){
var obj=Game.ActiveObject;
if(obj!=lst){
if(obj.Caption=="button")
Game.PlaySound("sounds\menu\button_on.wav");
else Game.PlaySound("sounds\menu\button_off.wav");
lst=obj;
}
Sleep(AMBIENT_LAG);
}
But what about window events? Or any other ideas? :)
-
Attach the following script to the button:
on "MouseEntry" this.PlaySound("button_on.wav");
on "MouseLeave" this.PlaySound("button_off.wav");
-
Thanks :) What about responses in the ResponseBox? Are LeftClick, MouseEntry and MouseLeave events in responses?
-
The response buttons are generated by the engine and you can't access them from scripts. If you need some advanced functionality for response selection, you'd have to reimplement the response box from scratch.