Page tree
Skip to end of metadata
Go to start of metadata


Introduction

Creates a button that can display text or textures (Procedural Textures or images), and which can be activated via specified keyboard presses.
Focus changes (via <Tab> or ctrlSetFocus) are only applies to buttons without defined shortcut keys.

See also: Dialogs Button, Dialogs_ActiveText
Related commands: Interactions - User Dialogs - General

Properties

Only properties unique to this control type are listed. For general properties, see the Properties page.

Sounds

Different sounds can be assigned to specific button states, via the properties 'soundClick', 'soundEnter', etc.
These definition though, can only use sound files that reside in an addon. Sound files from a mission cannot be used this way! In order to use sounds from mission folders, use Attachments instead. (see demo mission Dialog_Sounds.zip for examples)

Textures

Properties that expect textures can use a String that contains either a Procedural Textures or a path to an image (PAA or JPG).

NameTypeReq'dRemarkScript
typeIntegerYesControl type: 16 (or CT_SHORTCUT_BUTTON, if using constants)n/a
styleIntegerYesMust be defined, but has no effect.
Text position is specified in the 'TextPos' class.
n/a
actionStringNoScript command(s) to execute when button is pressed.
Must use double quotes; single quotes or curly brackets will not work.
No "this" or "_this" variable is available. If information about the control is needed, use an VBS User Interface Event Handlers instead.
buttonSetAction
animTextureDefaultTextureYesTexturen/a
animTextureDisabledTextureYesTexturen/a
animTextureFocusedTextureYesTexture used when control has focus (but not mouseOver).n/a
animTextureNormalTextureYesTexturen/a
animTextureOverTextureYesTexture used during mouseOver.n/a
animTexturePressedTextureYesTexture used when button is activated (either via mouse-click or an assigned shortcut key).n/a
colorColorYesText color. Will cycle between this and 'color2' during mouseOver.n/a
color2ColorYesAlternating text color.n/a
colorActiveBackgroundColorNo
n/a
colorBackgroundColorYes
n/a
colorBackground2ColorYes
n/a
colorDisabledColorYesText color if control has been ctrlEnable.n/a
defaultBooleanNo
n/a
HitZoneClassNo
n/a
periodFloatNo
n/a
periodFocusFloatNo
n/a
periodOverFloatNoSpeed (in sec.) at which text color is cycled, when mouse is over button.n/a
ShadowIntegerNo0,1 or 2n/a
ShortcutPosClassYes
n/a
shortcutsArrayNoArray of DIK KeyCodes that defined key-presses which will activate this button.n/a
SizeFloatYesFont size. ('sizeEx', as used in other control types, has no effect.)n/a
soundClickArray SoundYesSound to play when button is released after a click.n/a
soundEscapeArray SoundYesSound to play when the button was clicked via the mouse, and then released outside the button area.n/a
soundEnterArray SoundNono effectn/a
soundPushArray SoundYesSound to play when button is clicked.n/a
textStringYesText to display.ctrlSetText
TextPosClassYes
n/a
textureNoShortcutStringYesTexture to show when no keys have been defined in 'shortcuts'.n/a

Event Handlers

Several event handlers can be assigned to buttons. Check Reference List for details (if the column "scope" contains a "B", then that respective event can be used with buttons).

Examples

The mission Dialog ShortCutButton.zip contains a demonstration of all of the styles shown below.

something with something

200px

class Dlg { idd = -1; movingEnable = true; class controls { class something { }; }; };