SOLVED: mouse over button and thed click button problem

Started by Slasher, Wed 24/12/2014 18:41:34

Previous topic - Next topic

Slasher

Hi,

I have a mouse over buttons script that works except the buttons won't take mouse clicks. I'm expecting a bool change before clicking  button to run events can you lend a hand please  (roll) I need it to stop repeating when the button is clicked and to start running events before repeating mouse over again.


Code: ags
}
  //Rep Exec

 //Example:

 if(gHealth.Visible==true) 
 if(played==false){
 if((mouse.x >Button15.X+gHealth.X)&&(mouse.x <Button15.X+Button15.Width+gHealth.X)){
 if((mouse.y >Button15.Y+gHealth.Y)&&(mouse.y <Button15.Y+Button15.Height+gHealth.Y)){
 Display("Thump him");
}
}
}


cheers

EDIT: It seems I overlooked.

This seems to do the trick for buttons on gui:

Code: ags
}
 if(gHealth.Visible==true) {
 if((mouse.x >Button15.X+gHealth.X)&&(mouse.x <Button15.X+Button15.Width+gHealth.X)){
 if((mouse.y >Button15.Y+gHealth.Y)&&(mouse.y <Button15.Y+Button15.Height+gHealth.Y)){
 cChar1.SayBackground("You could thump him!");
 played=true;
}
}


 if((mouse.x >Button42.X+gHealth.X)&&(mouse.x <Button42.X+Button42.Width+gHealth.X)){
 if((mouse.y >Button42.Y+gHealth.Y)&&(mouse.y <Button42.Y+Button42.Height+gHealth.Y)){
 cChar1.SayBackground("You could jump on him!");
 played=true;
}
}

 // etc etc


Happy days  (laugh)



SMF spam blocked by CleanTalk