| Blockland Forums > Modification Help |
| Checking when a button on a GUI is pressed? |
| (1/1) |
| soba:
I'm creating a GUI, however, I cannot settle with the simple command a button would do, I need to check when its pressed elsewere |
| mp7964:
Err.. I don't really understand what you want. You could make it call a function that sets a global variable like $MyGUI::ButtonPressed to 1. --- Code: ---function MyGUI_ButtonPressed() { $MyGUI::ButtonPressed = 1; //Do other stuff } function MyGUI_CheckButtonPressed() { if($MyGUI::ButtonPressed == 1) { //Do stuff } else { //Do other stuff } } --- End code --- Just make the command the button does to MyGUI_ButtonPressed(). |
| jes00:
--- Quote from: mp7964 on November 16, 2011, 07:17:03 PM ---Err.. I don't really understand what you want. --- End quote --- Same. |
| LeetZero:
Perhaps about after pressing a button in the GUI a function is actually triggered. |
| soba:
Guys, the topic died and I alraedy figured it out lol |
| Navigation |
| Message Index |