Chapter 5 sick of the assumptions.....
by Nick Difrancisco · in Torque Game Engine · 11/18/2007 (12:09 pm) · 2 replies
So like most people I'm getting pretty frustrated with this book. Not only to I have to deal with my school not structuring our reading sequentially, I'm now dealing with all the assumptions this book makes.
Now heres my problem I'm going through the code for the client control module and for the most part I understand how it all works till i get to this line
function SplashScreenInputCtrl::onInputEvent(%this, %dev, %evt, %make)
{
if(%make)
{
ShowMenuScreen();
}
}
Now I understand what it does I just dont understand where the onInputEvent Function comes from or where the variables are defined and what they are supposed to do, other than I know %make is a mouse click which exits the splashscreen and takes us to the menuscreen.
So if someone could please explain the onInputEvent (basically where to find this function or if its part of torque) and how I can lets say change the variables definaitions to do something different ( for example pressing spacebar instead of a mouseclick to get to the menuscreen.)
Now heres my problem I'm going through the code for the client control module and for the most part I understand how it all works till i get to this line
function SplashScreenInputCtrl::onInputEvent(%this, %dev, %evt, %make)
{
if(%make)
{
ShowMenuScreen();
}
}
Now I understand what it does I just dont understand where the onInputEvent Function comes from or where the variables are defined and what they are supposed to do, other than I know %make is a mouse click which exits the splashscreen and takes us to the menuscreen.
So if someone could please explain the onInputEvent (basically where to find this function or if its part of torque) and how I can lets say change the variables definaitions to do something different ( for example pressing spacebar instead of a mouseclick to get to the menuscreen.)
#2
Um, yesterday i found this program called Codeweaver. You can right click on any method and click 'Go to Definition...' and if the code is somewhere in your project it will show you where. It's a TorqueScript editor and it has helped to greatly reduce my unnoticed typos. After using it for most of yesterday and all day today i really like it. You should try it. :)
You can change what the keys do using the bind method. There are some on page 203 from control/client/misc/presetkeys.cs. (In the tutorial.base model key bindings can be found in /example/tutorial.base/client/default.bind.cs )
03/15/2008 (12:36 am)
Quote:I just dont understand where the onInputEvent Function comes from or where the variables are defined and what they are supposed to do
Um, yesterday i found this program called Codeweaver. You can right click on any method and click 'Go to Definition...' and if the code is somewhere in your project it will show you where. It's a TorqueScript editor and it has helped to greatly reduce my unnoticed typos. After using it for most of yesterday and all day today i really like it. You should try it. :)
Quote:and how I can lets say change the variables definaitions to do something different ( for example pressing spacebar instead of a mouseclick to get to the menuscreen.)
You can change what the keys do using the bind method. There are some on page 203 from control/client/misc/presetkeys.cs. (In the tutorial.base model key bindings can be found in /example/tutorial.base/client/default.bind.cs )
Torque Owner Wysardry