1.5 How do I pause the game?
by Conor O Kane · in Torque Game Builder · 07/15/2007 (12:49 am) · 3 replies
The pause/play/stop buttons are gone from the game in v1.5 - how do I pause now?
#2
with that lil function, you can bind a key (say "P") to that function and it will pause the game and show an onscreen message.
07/15/2007 (2:56 pm)
I took your advice, and created a "simple" function for that...function gamePause(%state)
{
%paused=$pShip.scenegraph.getscenepause();
switch$(%state)
{
case "pause":
if (!%paused)
{
$pause=$mGUI.createTextTag(1, 2, "center", 10, 1, 0.80);
$pause.text="*** GAME PAUSED ***";
$pause.setPosition(0,0);
$obj.scenegraph.schedule(150, "setscenepause", true);
}
else
{
$pause.safeDelete();
$obj.scenegraph.setscenepause(false);
}
case "release":
return;
}
}with that lil function, you can bind a key (say "P") to that function and it will pause the game and show an onscreen message.
#3
07/15/2007 (5:51 pm)
Thanks very much for the help! That $timescale setting could be useful too - I never knew you could slow the game down!
Torque Owner DragonSix
yourt2dscenegraph.setscenepause([true for pause - false to unpause])
or/and
$timescale = [0 to pause - 1 to unpause]