show_question(str)

Drag & Drop equivalent : action_ifquestion

 

str = a string (the question) that the user is supposed to answer yes or no to, it can be a string inside quotation marks, or it can be a variable without quotations.

 

This function will make a message box appear, but this message box will have 2 choices, yes and no, just like the corresponding drag & drop action. You must store this in a variable, otherwise your yes/no info will be discarded from the game.

 

Example #1:

//exit game code

//escape press event

quit = show_question("do you want to exit")

switch(quit)

{

case 0:

break;

case 1:

game_end();break;

}   

// note that for this to work you must in the global game settings menu,

// disable "let escape end the game"

 

Example #2:

//in the space pressed event

learn = show_question("do you want to learn gml?")

if learn = false then

{

show_message("then exit this program")

}

else if learn = true then

{

show_message("then this is a good program to learn from")

}

 

 

cityscape - Revision #1