Game Development Community

Clickable text

by Tim Doty · in Torque Game Builder · 04/09/2006 (11:00 am) · 1 replies

I'm still trying to come to terms with the GUI objects in T2D so please bear with me. I want to create a popup menu when the user right clicks. Although I eventually got somewhere, sort of, with the MenuBar object that isn't really what I'm after -- that is geared to having permanent menus.

What I settled on was using a GuiWindowCtrl with none of the gadgets (not closable, resizable, etc.), just the title bar and the body. That works fine, but I'm having an issue with the elements. If I use GuiButtonCtrl then it works like I want (click a listing to execute a function), but there is a mandatory border for the text which is ugly.

I've tried setting it to the GuiText profile, but the result is the same.

Likewise I've tried creating the items as GuiTextCtrl which looks right, but they aren't clickable (even though you can associate a command I haven't found a way to trigger it), even with setting the GuiButton profile.

I'm hoping someone can shed some light on where I'm going wrong.

Tim Doty

#1
04/11/2006 (3:54 am)
In case someone with a similar problem runs across this, the answer is to create a new gui profile. These must be loaded before the .gui file(s) using them and so perhaps best belong in common\gui\profiles.cs -- but as I really prefer not modifying common files if at all possible so the game will just drop into a new engine I wrote a function addGuiProfiles() in my onStartup.cs and slightly altered my exec() structure:

// global
exec("./onStartup.cs");
exec("./sgomHexes.cs");

addGuiProfiles();

// client
exec("./client/initClient.cs");
exec("./client/clientCommands.cs");

// server
exec("./server/initServer.cs");
exec("./server/serverCommands.cs");

// gui
exec("SGoM/gui/sgomScreen.gui");
exec("SGoM/gui/sgomBoardScreen.gui");

edit: forgot to copy the gui section of the exec.cs file into the example...