Torque 3D - Script Manual: GuiClockHud Class Reference

TorqueScript

Main   Class List   Namespace List   Online

GuiClockHud Class Reference
[Game Controls]

Basic HUD clock. Displays the current simulation time offset from some base. More...

Inheritance diagram for GuiClockHud:

List of all members.

Public Member Functions

float getTime ()
 Returns the current time, in seconds.
void setReverseTime (float timeInSeconds=60)
 Sets a time for a countdown clock.
void setTime (float timeInSeconds=60)
 Sets the current base time for the clock.

Public Attributes

Misc

ColorF fillColor
 Standard color for the background of the control.
ColorF frameColor
 Color for the control's frame.
bool showFill
 If true, draws a background color behind the control.
bool showFrame
 If true, draws a frame around the control.
ColorF textColor
 Color for the text on this control.

Detailed Description

Basic HUD clock. Displays the current simulation time offset from some base.

Example:
 new GuiClockHud(){
   fillColor = "0.0 1.0 0.0 1.0"; // Fills with a solid green color
   frameColor = "1.0 1.0 1.0 1.0"; // Solid white frame color
   textColor = "1.0 1.0 1.0 1.0"; // Solid white text Color
   showFill = "true";
   showFrame = "true";
};

Member Function Documentation

float GuiClockHud::getTime (  ) 

Returns the current time, in seconds.

Returns:
timeInseconds Current time, in seconds
Example:
// Get the current time from the GuiClockHud control
%timeInSeconds = %guiClockHud.getTime();
void GuiClockHud::setReverseTime ( float  timeInSeconds = 60  ) 

Sets a time for a countdown clock.

Setting the time like this will cause the clock to count backwards from the specified time.

Parameters:
timeInSeconds Time to set the clock, in seconds (IE: 00:02 would be 120)
See also:
setTime
void GuiClockHud::setTime ( float  timeInSeconds = 60  ) 

Sets the current base time for the clock.

Parameters:
timeInSeconds Time to set the clock, in seconds (IE: 00:02 would be 120)
Example:
// Define the time, in seconds
%timeInSeconds = 120;

// Change the time on the GuiClockHud control
%guiClockHud.setTime(%timeInSeconds);

Member Data Documentation

Standard color for the background of the control.

Color for the control's frame.

If true, draws a background color behind the control.

If true, draws a frame around the control.

Color for the text on this control.



Copyright © GarageGames, LLC. All Rights Reserved.