Getting Started - buttons not visible
by Judith Hudson · in Torque Game Engine · 11/07/2004 (6:55 pm) · 3 replies
I'm working my way through the Getting Started documentation. When I did the lesson on adding buttons (my first button), the button showed up fine but when I restart the fps demo, the new button is not visible. I saved mainMenugui.gui as instructed. When I open the file, the new button appears to be present. Am I supposed to add something to init.cs or delete the dso file?
About the author
#2
11/08/2004 (4:30 am)
I did that and found that the program would not compiled. I then restored the original files and reran the tutorial. Everything worked ok. I must have mistyped something. Thanks. I have buttons!
#3
my button starts a singleplayer game, and the gui looks like this
11/08/2004 (4:41 am)
Well i have added to client/init.cs for my button//ace
function loadSinglePlayer()
{
// Display the loading GUI
Canvas.setContent(LoadingGui);
LOAD_MapName.setText( "Creating Single Player Game" );
LOAD_MapDescription.setText( "<font:Arial:16>Please wait while the Single Player is started...");
Canvas.repaint();
// Start up the server..
createServer("SinglePlayer", "starter.quest/data/missions/home.mis");
%conn = new GameConnection(ServerConnection);
RootGroup.add(ServerConnection);
%conn.setConnectArgs($pref::Player::Name);
%conn.setJoinPassword($Client::Password);
%conn.connectLocal();
}
//endacemy button starts a singleplayer game, and the gui looks like this
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "35 242";
extent = "111 35";
minExtent = "8 2";
visible = "1";
command = "loadSinglePlayer();";
text = "Play Single Player ";
groupNum = "-1";
buttonType = "PushButton";
helpTag = "0";
};
Associate Kyle Carter