Sorry, perhaps I'm just too tired... but:
I want to check if the mouse is over a certain GUI-Button (cause then a label with a description should appear). I only found solutions for either other locations (hotspots, regions etc.) or for GUI-buttons when a mousebutton is pressed but that's not the case.
I guess GetAtScreenXY (http://www.adventuregamestudio.co.uk/manual/GUIControl.GetAtScreenXY.htm) could help but I admit that I don't quite understand that command.
So any help is appreciated.
function rep_exec() {
GuiControl*button=GuiControl.GetAtScreenXY(mouse.x,mouse.y);
if (button==Btnnamehere) {
//ecc
}
Note: That GuiControl can be used for all GUI controls.
There is no sense in checking the mouse each and every loop (since it's in the Rep_Exec) if the GUI isn't even visible.
So I'd just put an if statement to check if it was visible, then run the code.
if (gwhatever.Visible==true) {
//check to see if mouse is over button code
}
Thanks, that works.
The only thing is that the "Gui" in GUIControl has to be written in capital letters in order to be recognized, but I could figure that out myself. :=
Quote from: matti on Sun 11/01/2009 23:11:59
Thanks, that works.
The only thing is that the "Gui" in GUIControl has to be written in capital letters in order to be recognized, but I could figure that out myself. :=
I'd kill you if you couldn't. 8)