Jump to content


Photo

Help With Proper Dialog Boxes


  • Please log in to reply
8 replies to this topic

#1 DioFlare

DioFlare

    GMC Member

  • New Member
  • 56 posts
  • Version:GM8

Posted 17 March 2011 - 02:24 AM

Would someone be kind enough to help me create a simple dialog box that appears when the player clicks on an object?

Thanks in advance,

DioFlare
  • 0

#2 Mayhem Games

Mayhem Games

    Proud Kiwi

  • GMC Member
  • 959 posts
  • Version:GM:Studio

Posted 17 March 2011 - 02:31 AM

You could use...
show_message("This is a GameMaker dialog box")
Or if you want to use a windows dialog box make sure you have the "GM_Windows_Dialogs" extention package is installed with your game file and use the following...
wd_message_set_text("This is a Windows message dialog")
wd_message_show(wd_mk_information,wd_mb_ok,wd_mb_none,wd_mb_none)
You can also cutomise the last code with the following...

wd_mk_none = No icon
wd_mk_warning = Warning icon
wd_mk_error = Error icon
wd_mk_information = Information icon
wd_mk_confirmation = Confirmation icon

There can be up to three buttons. These are indicated by the arguments but1, but2 and but3. Their values can be:
wd_mb_none = No button (used when less than three buttons are required)
wd_mb_ok = Ok button
wd_mb_cancel = Cancel button
wd_mb_yes = Yes button
wd_mb_no = No button
wd_mb_abort = Abort button
wd_mb_retry = Retry button
wd_mb_ignore = Ignore button


Edited by Mayhem Games, 17 March 2011 - 02:33 AM.

  • 1

#3 Desert Dog

Desert Dog

    GMC Member

  • Retired Staff
  • 6409 posts
  • Version:Unknown

Posted 17 March 2011 - 02:33 AM

What sort of dialogue box?

show_message("Hi this is a message!")

show_question("This asks a question and gives you buttons to press, yes/no")

show_message_ext("This is an extended version which can gives you up to 3 buttons, with your own custom
text on each!","Button1","Button2","Button3")

those sorts of dialogue boxes? Or do you mean one where the user can write in (get_string() and get_integer())
  • 1

#4 DioFlare

DioFlare

    GMC Member

  • New Member
  • 56 posts
  • Version:GM8

Posted 18 March 2011 - 02:47 AM

What sort of dialogue box?

show_message("Hi this is a message!")

show_question("This asks a question and gives you buttons to press, yes/no")

show_message_ext("This is an extended version which can gives you up to 3 buttons, with your own custom
text on each!","Button1","Button2","Button3")

those sorts of dialogue boxes? Or do you mean one where the user can write in (get_string() and get_integer())



The interactive kind.


  • 0

#5 Desert Dog

Desert Dog

    GMC Member

  • Retired Staff
  • 6409 posts
  • Version:Unknown

Posted 18 March 2011 - 02:52 AM

interactive doesn't tell me an awful lot.

Try this, plonk it in the <enter> pressed event, and see how you like it

get_string("Please Enter something.. interactive!","Write your stuff here");
  • 1

#6 DioFlare

DioFlare

    GMC Member

  • New Member
  • 56 posts
  • Version:GM8

Posted 18 March 2011 - 02:58 AM

interactive doesn't tell me an awful lot.

Try this, plonk it in the <enter> pressed event, and see how you like it

get_string("Please Enter something.. interactive!","Write your stuff here");



Nice! :D Problem is, I don't know how to use to create events like, "Buy this?" and if the player says yes, then what?


  • 0

#7 Desert Dog

Desert Dog

    GMC Member

  • Retired Staff
  • 6409 posts
  • Version:Unknown

Posted 18 March 2011 - 03:04 AM

You can do it with show_question

if show_question("Do you want to buy Prison Ball?")==1
{
// he bought it!
}
else
{
//no he didn't buy it
}

That will have 2 buttons.. yes and no.

We can do it using the get_string one, where they can type answers, but it becomes trickier to work with.. first try this one, and see if it isn't what you want. If it is, then sweet! If it isn't then... we're going to have work to do!!
  • 1

#8 DioFlare

DioFlare

    GMC Member

  • New Member
  • 56 posts
  • Version:GM8

Posted 18 March 2011 - 03:08 AM

You can do it with show_question

if show_question("Do you want to buy Prison Ball?")==1
{
// he bought it!
}
else
{
//no he didn't buy it
}

That will have 2 buttons.. yes and no.

We can do it using the get_string one, where they can type answers, but it becomes trickier to work with.. first try this one, and see if it isn't what you want. If it is, then sweet! If it isn't then... we're going to have work to do!!


Alright, thank you for all your help! I'll be experimenting and playing around with these codes you've taught me. I'll send you a message if I need any more help.



  • 0

#9 Desert Dog

Desert Dog

    GMC Member

  • Retired Staff
  • 6409 posts
  • Version:Unknown

Posted 18 March 2011 - 04:57 AM

No problem. :) Posting on this forum might give you a faster reply... I'm not always online to check PMs!

g'luck,
~D
  • 1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users