Torque 3D - Script Manual: Platform

TorqueScript

Main   Class List   Namespace List   Online

Platform

Classes

class  RigidShape
 The RigidShape class implements rigid-body physics for DTS objects in the world. More...
class  RigidShapeData
 Defines the physics properties for an individual RigidShapeData physics object. More...

Modules

 Localization
 

Classes and functions related Torque 3D networking.


 Mac
 

Functionality exclusive to Torque on OSX.


 Windows
 

Functionality exclusive to Torque on Windows.


Enumerations

enum  MBButtons {
  Ok,
  OkCancel,
  RetryCancel,
  SaveDontSave,
  SaveDontSaveCancel
}
 

Which buttons to display on a message box.

More...
enum  MBIcons {
  Information,
  Warning,
  Stop,
  Question
}
 

What icon to show on a message box.

More...
enum  MBReturnVal {
  OK,
  Cancelled,
  Retry,
  DontSave
}
 

Return value for messageBox() indicating which button was pressed by the user.

More...

Functions

bool displaySplashWindow ()
 Display a startup splash window suitable for showing while the engine still starts up.
int getRealTime ()
 Return the current real time in milliseconds.
int getSimTime ()
 Sim time is time since the game started.
bool getWebDeployment ()
 Test whether Torque is running in web-deployment mode.
void gotoWebPage (string address)
 Open the given URL or file in the user's web browser.
bool isDebugBuild ()
 Test whether the engine has been compiled with TORQUE_DEBUG, i.e. if it includes debugging functionality.
bool isShippingBuild ()
 Test whether the engine has been compiled with TORQUE_SHIPPING, i.e. in a form meant for final release.
bool isToolBuild ()
 Test whether the engine has been compiled with TORQUE_TOOLS, i.e. if it includes tool-related functionality.
int messageBox (string title, string message, MBButtons buttons=MBOkCancel, MBIcons icons=MIInformation)
 Display a modal message box using the platform's native message box implementation.
void playJournal (string filename)
 Begin playback of a journal from a specified field.
void quit ()
 Shut down the engine and exit its process.
void quitWithErrorMessage (string message)
 Display an error message box showing the given message and then shut down the engine and exit its process.
void saveJournal (string filename)
 Save the journal to the specified file.
bool shellExecute (string executable, string args, string directory)
 Launches an outside executable or batch file.

Variables

const int $MRCancel
 Determines the cancel button press state in a message box.
const int $MRDontSave
 Determines the don't save button press state in a message box.
const int $MROk
 Determines the ok button press state in a message box.
const int $MRRetry
 Determines the retry button press state in a message box.
int $platform::backgroundSleepTime
 Controls processor time usage when the game window is out of focus.
int $platform::timeManagerProcessInterval
 Controls processor time usage when the game window is in focus.

Detailed Description


Enumeration Type Documentation

enum MBButtons

Which buttons to display on a message box.

Enumerator:
Ok 
OkCancel 
RetryCancel 
SaveDontSave 
SaveDontSaveCancel 
enum MBIcons

What icon to show on a message box.

Enumerator:
Information 
Warning 
Stop 
Question 

Return value for messageBox() indicating which button was pressed by the user.

Enumerator:
OK 
Cancelled 
Retry 
DontSave 

Function Documentation

bool displaySplashWindow (  ) 

Display a startup splash window suitable for showing while the engine still starts up.

Note:
This is currently only implemented on Windows.
Returns:
True if the splash window could be successfully initialized.
int getRealTime (  ) 

Return the current real time in milliseconds.

Real time is platform defined; typically time since the computer booted.

int getSimTime (  ) 

Sim time is time since the game started.

Return the current sim time in milliseconds.

bool getWebDeployment (  ) 

Test whether Torque is running in web-deployment mode.

In this mode, Torque will usually run within a browser and certain restrictions apply (e.g. Torque will not be able to enter fullscreen exclusive mode).

Returns:
True if Torque is running in web-deployment mode.
void gotoWebPage ( string  address  ) 

Open the given URL or file in the user's web browser.

Parameters:
address The address to open. If this is not prefixed by a protocol specifier ("...://"), then the function checks whether the address refers to a file or directory and if so, prepends "file://" to adress; if the file check fails, "http://" is prepended to address.
Example:
gotoWebPage( "http://www.garagegames.com" );
bool isDebugBuild (  ) 

Test whether the engine has been compiled with TORQUE_DEBUG, i.e. if it includes debugging functionality.

Returns:
True if this is a debug build; false otherwise.
bool isShippingBuild (  ) 

Test whether the engine has been compiled with TORQUE_SHIPPING, i.e. in a form meant for final release.

Returns:
True if this is a shipping build; false otherwise.
bool isToolBuild (  ) 

Test whether the engine has been compiled with TORQUE_TOOLS, i.e. if it includes tool-related functionality.

Returns:
True if this is a tool build; false otherwise.
int messageBox ( string  title,
string  message,
MBButtons  buttons = MBOkCancel,
MBIcons  icons = MIInformation 
)

Display a modal message box using the platform's native message box implementation.

Parameters:
title The title to display on the message box window.
message The text message to display in the box.
buttons Which buttons to put on the message box.
icons Which icon to show next to the message.
Returns:
One of $MROK, $MRCancel, $MRRetry, and $MRDontSave identifying the button that the user pressed.
Example:
messageBox( "Error", "" );
void playJournal ( string  filename  ) 

Begin playback of a journal from a specified field.

Parameters:
filename Name and path of file journal file
void quit (  ) 

Shut down the engine and exit its process.

This function cleanly uninitializes the engine and then exits back to the system with a process exit status indicating a clean exit.

See also:
quitWithErrorMessage
void quitWithErrorMessage ( string  message  ) 

Display an error message box showing the given message and then shut down the engine and exit its process.

This function cleanly uninitialized the engine and then exits back to the system with a process exit status indicating an error.

Parameters:
message The message to log to the console and show in an error message box.
See also:
quit
void saveJournal ( string  filename  ) 

Save the journal to the specified file.

bool shellExecute ( string  executable,
string  args,
string  directory 
)

Launches an outside executable or batch file.

Parameters:
executable Name of the executable or batch file
args Optional list of arguments, in string format, to pass to the executable
directory Optional string containing path to output or shell

Variable Documentation

int $MRCancel

Determines the cancel button press state in a message box.

int $MRDontSave

Determines the don't save button press state in a message box.

int $MROk

Determines the ok button press state in a message box.

int $MRRetry

Determines the retry button press state in a message box.

int $platform::backgroundSleepTime

Controls processor time usage when the game window is out of focus.

int $platform::timeManagerProcessInterval

Controls processor time usage when the game window is in focus.



Copyright © GarageGames, LLC. All Rights Reserved.