Torque 3D - Script Manual: GuiSpeedometerHud Class Reference

TorqueScript

Main   Class List   Namespace List   Online

GuiSpeedometerHud Class Reference
[Container Controls]

Displays the speed of the current Vehicle based control object. More...

Inheritance diagram for GuiSpeedometerHud:

List of all members.

Public Attributes

Needle

Point2F center
 Center of the needle, offset from the GuiSpeedometerHud control top left corner.
ColorF color
 Color of the needle.
float length
 Length of the needle from center to end.
float maxAngle
 Angle (in radians) of the needle when the Vehicle speed is >= maxSpeed. An angle of 0 points right, 90 points up etc).
float maxSpeed
 Maximum Vehicle speed (in Torque units per second) to represent on the speedo (Vehicle speeds greater than this are clamped to maxSpeed).
float minAngle
 Angle (in radians) of the needle when the Vehicle speed is 0. An angle of 0 points right, 90 points up etc).
float tail
 Length of the needle from center to tail.
float width
 Width of the needle.

Detailed Description

Displays the speed of the current Vehicle based control object.

This control only works if a server connection exists, and its control object is a Vehicle derived class. If either of these requirements is false, the control is not rendered.
The control renders the speedometer needle as a colored quad, rotated to indicate the Vehicle speed as determined by the minAngle, maxAngle, and maxSpeed properties. This control is normally placed on top of a GuiBitmapCtrl representing the speedometer dial.

Example:
new GuiSpeedometerHud()
{
   maxSpeed = "100";
   minAngle = "215";
   maxAngle = "0";
   color = "1 0.3 0.3 1";
   center = "130 123";
   length = "100";
   width = "2";
   tail = "0";
   //Properties not specific to this control have been omitted from this example.
};

Member Data Documentation

Center of the needle, offset from the GuiSpeedometerHud control top left corner.

Color of the needle.

Length of the needle from center to end.

Angle (in radians) of the needle when the Vehicle speed is >= maxSpeed. An angle of 0 points right, 90 points up etc).

Maximum Vehicle speed (in Torque units per second) to represent on the speedo (Vehicle speeds greater than this are clamped to maxSpeed).

Angle (in radians) of the needle when the Vehicle speed is 0. An angle of 0 points right, 90 points up etc).

Length of the needle from center to tail.

Width of the needle.



Copyright © GarageGames, LLC. All Rights Reserved.