Game Development Community

I have a few GUI questions :)

by Shane09 · in General Discussion · 01/17/2009 (8:15 am) · 7 replies

I have successfully completed my MainMenuGui along with a button (GuiBitmapButtonCtrl) that I want to have it so when you click on it, the game loads to a different GUI screen where you load your profile. I have been searching for quite some time now, and I still can't find the command for loading another screen. Thanks in advance.

#1
02/27/2009 (3:14 pm)
*BUMP*
#2
02/27/2009 (3:29 pm)
I'm not too sure if this is what I do, but is this correct?

command = "Canvas.setContent(MYGUIHERE);";

I change "MYGUIHERE" to the screen I want to have loaded?

Thanks in advance.
#3
02/27/2009 (5:18 pm)
Or you can use Canvas.pushDialog(DialogName) to push a GUI, and Canvas.popDialog(DialogName) to pop it...
#4
02/27/2009 (5:25 pm)
Ah, ok. Thanks.
#5
02/28/2009 (7:51 am)
Hmm. A problem has occured. I created a '.gui' that I wanted to load. I called it 'TestGui.gui'. The command on the PushButton that you click to load is as follows:

Command = "Canvas.setContent(TestGui);";

1) A '.dso' was not created when I ran the application.

2) Nothing happens when I click the PushButton that is supposed to load 'TestGui.gui'.

3) The console gave this error:
Quote:
setContent(): Invalid control: TestGui

Any help is appreciated. I just can't seem to get it working.
#6
02/28/2009 (8:57 am)
Is there an error in TestGui.gui? Is "TestGui" a valid gui? It's difficult to tell what's going wrong without seeing the whole gui.
#7
02/28/2009 (9:02 am)
Here is the script to 'TestGui.gui'

//--- OBJECT WRITE BEGIN ---
new GuiChunkedBitmapCtrl(TestGui) {
   canSaveDynamicFields = "0";
   Profile = "GuiContentProfile";
   HorizSizing = "relative";
   VertSizing = "relative";
   position = "0 0";
   Extent = "640 480";
   MinExtent = "8 8";
   canSave = "1";
   Visible = "1";
   hovertime = "1000";
   bitmap = "./background.png";
   useVariable = "0";
   tile = "0";

Quote:
Is "TestGui" a valid gui?
What do you mean by "valid"? I am executing it in the 'init.cs'.

P.S. I switched over to 'starter'.fps' not too long ago. I managed to get everything from 'tutorial.base' functioning correctly in 'starter.fps'.

ALSO
I'm working on getting a message to pop up when the player enters a trigger. I'm looking at this thread to make this happen. However, is it possible I can have the message disappear after a certain amount of time? I'm going to use a '.png' for the message.