Register to post in forums, or Log in to your existing account
 

 Related 
Contents
See also:
  Editing Gauges
  Buttons
  Editing Buttons
Feature Reference
  Aliases
  Macros
  Variables
  Functions
  Classes
  Triggers
  Buttons
  Gauges
  Paths
  Menus
  Events
  Modules
  Windows
  Packages
  Shared Package Library
  Package Editor
  Docked Windows
  Customizeable Toolbars
  Sessions
  Expressions
  Automapper Module
  Database Module
  Syntax Checking
  Tab Completion
  Status items
  Preferences
  Simutronics Support
  Pueblo Emulation
  Keyboard shortcuts
  MXP
  Threads
  ATCP
  Script Debugger
  Timestamps
  Lua Scripting
Related Links:
  Create/Modify Settings
  Feature Summary
  Editing Buttons
  Buttons
Gauges [[cmud_gauges]] 

A "Gauge" is a special type of a button that can show a graphical progress bar. It might seem strange to think of a graphical gauge as a button, but in CMUD you can click on a gauge to execute a script, just like with a button. Gauges are displayed in the same button bars within the window that buttons are, allowing you to arrange the graphical status gauges next to other button controls.

A Gauge tracks the value of a variable (or expression) graphically. The Gauge has a main Value field which gives the expression to be computed. The MaxValue field is the expression which defines the maximum extent of the gauge.

The easiest way to create a gauge is via the Package Editor. Create a button, then set the Button Type to the "Gauge" value. A new "Gauge" tab will appear along the bottom of the editor window to allow you to edit the various gauge properties. See the Editing Gauges topic for details on the editor screen fields.

To create a gauge from the command line, use the #GAUGE command. For example, to create a gauge to display your hitpoints, you can use this:

#GAUGE hp "" @hp @maxhp

The first two arguments give the ID (shortcut name) and Caption values for the gauge. The @hp argument is the expression to evaluate to determine the main Value of the gauge, and the @maxhp argument is the expression used to determine the maximum value of the gauge.

See the #GAUGE command topic for details on specifying colors and other arguments via the command line.

The Caption field is expanded for variables and functions when the gauge is displayed. In the example show at the top of this screen, the caption was set to: @hp/@maxhp which then ends up displaying the caption of "300/400" when hp=300 and maxhp=400. The Text color of the caption is changed on the normal Button Options editor screen.
Viewer Comments [0 - Post your comments]

Jump to:  

© 2009 Zugg Software. Hosted by Wolfpaw.net