Jibble

Author Topic: Making a phone GUI  (Read 1357 times)

MrCheminee

  • Posts: 115
  • Say it, baby!
    • I can help with making music
Making a phone GUI
« on: 08 Jan 2010, 10:01 »
Hi you guys!

I've been trying to make a cellphoneGUI pop up whenever the player selects his phone in his inventory. So far I have run into a few problems I can't find an answer for.
Within the GUI, I want to let the pressed button light up, this is no problem, but I also want to show the chosen button on the display of the phone. If this was a room I would just plant a bunch of invisible objects in it and turn the right one visible, but I just can't find how to put objects in my GUI.
Second question is: How do I make it possible to have a Dialog with the phone? Should I import an invisible character, named phone? But then how do I put this character inside the GUI?

I realise that it might be easier for me to just make a 'phoneroom', but I rather keep the room the player is in on the background while using the phone...

RickJ

  • Posts: 2,871
  • fix'n one thing and break'n two ...
    • I can help with scripting
    • I can help with story design
    • RickJ worked on a game that was nominated for an AGS Award!
Re: Making a phone GUI
« Reply #1 on: 08 Jan 2010, 12:43 »
As you correctly surmise it's not possible to have objects or characters on/in a GUI.   

1.  Use buttons instead of objects.  You can play with the Button.NormalGraphic and
Button.Visible properties to get the effect your desire.

2.  Ypu can incorporate the dialog into your phone GUI.  Have a look at "Dialog options, custom rendering" in the manual.


Khris

  • Posts: 10,676
  • having to deal with what games are going through
    • Lifetime Achievement Award Winner
    • I can help with play testing
    • I can help with scripting
    • I can help with translating
    • Khris worked on a game that was nominated for an AGS Award!
Re: Making a phone GUI
« Reply #2 on: 08 Jan 2010, 12:49 »
You can also redraw the look of pretty much anything on the fly.
I'd create a single button representing the display, then redraw its NormalGraphic depending on what the display's supposed to be showing.

MrCheminee

  • Posts: 115
  • Say it, baby!
    • I can help with making music
Re: Making a phone GUI
« Reply #3 on: 08 Jan 2010, 13:58 »
Allright, I thank both of you, I'll check those options out!

MrCheminee

  • Posts: 115
  • Say it, baby!
    • I can help with making music
Re: Making a phone GUI
« Reply #4 on: 08 Jan 2010, 15:32 »
When I'm using the phone and I use a command that pauses, like Wait(20); (to let the button image show up for a short moment) suddenly all my buttons get a shade while it is waiting. I suppose it just something that's right in front of me, but I can't find where this comes from. Any ideas?

ThreeOhFour

  • Posts: 2,948
  • Wild colonial boy.
    • Lifetime Achievement Award Winner
    • ThreeOhFour worked on a game that won an AGS Award!
    •  
    • ThreeOhFour worked on a game that was nominated for an AGS Award!
Re: Making a phone GUI
« Reply #5 on: 08 Jan 2010, 15:35 »
Go to the 'visual' section (second from bottom) in the 'general settings' pane and change the setting for "When interface is disabled, guis should" to 'Display normally'.

MrCheminee

  • Posts: 115
  • Say it, baby!
    • I can help with making music
Re: Making a phone GUI
« Reply #6 on: 08 Jan 2010, 15:40 »
Great, that did it! Thanks a lot!

MrCheminee

  • Posts: 115
  • Say it, baby!
    • I can help with making music
Re: Making a phone GUI
« Reply #7 on: 08 Jan 2010, 18:34 »
I solved the imageproblem by making 5 buttons for the phone display. The phonenumbers contain 4 figures, so for each position on the display I made 1 button and  I made one bigger button that arranged the whole background of the display, for showing the provider and displaying messages like: Connecting and Wrong number.
So thanks for the solution!
Tomorrow I'll start working out the dialog.
« Last Edit: 08 Jan 2010, 22:47 by MrCheminee »

MrCheminee

  • Posts: 115
  • Say it, baby!
    • I can help with making music
Re: Making a phone GUI
« Reply #8 on: 14 Apr 2010, 21:10 »
I chose to let the GUI call an invisible persoon to the room as the speaker on the phone, while putting my charcters speechview to one with him holding the phone, unfortunately whenever I call the dialog, the GUI script finishes first, putting the character back in his normal speechview, and clearing the phone display, is there any way to prevent this from happening?
« Last Edit: 15 Apr 2010, 10:23 by MrCheminee »

MrCheminee

  • Posts: 115
  • Say it, baby!
    • I can help with making music
Re: Making a phone GUI
« Reply #9 on: 14 Apr 2010, 21:19 »
As I was typing this I thought of the following solution: I'll let the GUI-script wait untill a variable turns to 1 (which I'd put on the end of the dialog script). But then the whole game pauses...

An other options could be translating all the dialog text to 'Say' commands and put those in the GUI, but I hope there is an easier solution around...

(A screenshot of the phone is put in the Fribbledib-topic, in the games in production section...)
« Last Edit: 14 Apr 2010, 21:51 by MrCheminee »

MrCheminee

  • Posts: 115
  • Say it, baby!
    • I can help with making music
Re: Making a phone GUI
« Reply #10 on: 15 Apr 2010, 16:51 »
Nevermind, I found a solution by putting the commands to go back to the normal speechview and emty the phonedisplay on the end of the dialog script instead of keeping it in the GUI script.