Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: spook1 on Thu 16/03/2006 22:33:24

Title: GUI button click does not work [SOLVED]
Post by: spook1 on Thu 16/03/2006 22:33:24
I created my own GUI and want to see a lable change value as I click a button.
When I click the button nothing happens though.

I am obviously missing something trivial, but what???

I have aÃ,  GUI with button: High_up


#sectionstart High_up_ClickÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function High_up_Click(GUIControl *control, MouseButton button) {
Ã,  if (HV < 296) { HV = HV + 5;}
}
#sectionend High_up_ClickÃ,  // DO NOT EDIT OR REMOVE THIS LINE

The int HV is exported to my room.
In the repeatedly execute of the room I call:

function room_b() {
Ã,  // script for Room: Repeatedly execute
Ã,  Ã, 
Ã,  String buf = String.Format("%d", HV);
Ã,  High_value.Text = buf;
Ã, 
}
#sectionend room_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE
Title: Re: GUI button click does not work
Post by: Ashen on Thu 16/03/2006 22:41:44
The obvious things to check:
Title: Re: GUI button click does not work
Post by: spook1 on Thu 16/03/2006 22:48:26
Wow, thats fast! Thanks!

I have tried the displays, but it seems that the buttons is not pressed.

In the Gui editor I have set for the button:

left click : run script
Click:        High_up_Click

I have only one room at the moment.

I am afraid it is something stupid.

I have the HV value declared in the global script (since I process them there by the button-click events)
From the global script I export it to the room script.

I try to clikc with a mouse.Mode = 6 (pointer). Also the mdes for walking, looking do not work ...

other suggestions??



Title: Re: GUI button click does not work
Post by: Ashen on Thu 16/03/2006 23:09:07
The cursor mode shouldn't affect clicking the GUI buttons (unless you mean look and walk aren't working anywhere?)
Do you have any other buttons (or other controls) on the GUI, and if so, do they work?

Is it possible that there's something (e.g. a transparent GUI) under the mouse, blocking the clicks? Could the GUI be set as not 'Clickable'?
Title: Re: GUI button click does not work
Post by: spook1 on Thu 16/03/2006 23:13:17
 :-[
Gui was set as not clickable.
:-[
Very stupid indeed. Sorry to have bothered you.
That is why I could not find the answer in the forums. The question was too stupid ;-)

Thanks for helping, suggesting these extreme simple things is really clever.
Regards,

Martijn