I must admit I can't follow you, Andy. From what I read in your tutorial you actually DO set up an invisible "click off panel".That's because if you read the tutorial, you'll notice I don't have you set up a "click off panel".
I think this needs more clarification because it doesn't work right out of the box. If you want this behaviour you have to assign a GUIButton component to the main GUI panel (in your example the note) as well as a TagID component with a value of 99 (if you use xDialogToggle). Only then the GUI will close down when you click on it.Using Modal Enabled, you do not need a click off panel. The player can simply click on the GUI pop up and it will go down
In my last post I forgot to add information on this and to be more specific.Actually you are supposed to be able to exit xDialogToggle by keyboard input as well.
GUIs that have 'modal' enabled never trigger OnControlKeyEvent. However, there obviously is another way to exit a 'modal' GUI by pressing the ESCAPE key (or the backspace key). For this to work you have to add the following lines in your OnGUINotify:
Code: Select all
if (event == kExitMode):
# trigger the closing of the dialog here
However, to repeat it one more time: OnControlKeyEvent is never called for modal GUIs (at least that's my conclusion from all the information I've gathered).
Using debug print commands I've found out that even in Cyan's xDialogToggle file the OnControlKeyEvent section is never called when the GUI is set to modal, not even when pressing ESCAPE.