Game Development Community

Gui - Home button and mouse

by Nick-Wright · in Torque Game Builder · 06/16/2009 (7:44 pm) · 2 replies

Hello, I have never used the gui builder before and was wondering if anyone could help me out with these two simple things.

1) Since I'm using the PSK the mouse is hidden and doesn't work, does anyone know how to make it show and work?

2) I need to make a simple button in the bottom left corner that brings you back to the level "Menu.t2d"

I have the behavior you can find at the tgb resources page called "level button"
This seems to be exactly what I need, however it is a behavior and I don't know
how you add behaviors to objects in the gui builder

Any ideas?

#1
06/17/2009 (2:29 pm)
Anyone have any experience with the gui builder?
#2
06/18/2009 (3:42 pm)
Hi Nick. This might be a case of the blind leading the blind as I don't have much gui builder experience nor the PSK (your post came up while I was trying to solve my own gui woes).

For the mouse I would wonder if it's a case of Canvas.cursorOff(); being called somewhere in the code. When I do this in my own gui I lose the mouse, so that would be one thing to look for.

In terms of your button this might not be correct but I've been assigning a class name (someButtonClass in the class name field) to my gui buttons then intercepting the click by assigning an onClick function for that class:
someButtonClass::onClick()
{
  //Do something with the click, like load a level
}

I'm using the code inside the behavior you mentioned to load new levels and I use it like this:

sceneWindow2D.schedule("1","loadLevel",expandFilename( "YourFileName" ) );

Hope that helps.