Torque3D Documentation / _generateds / GuiBitmapButtonCtrl

GuiBitmapButtonCtrl

Engine/source/gui/buttons/guiBitmapButtonCtrl.h

A button control that uses bitmaps as its different button states.

More...

Classes:

Callbacks

DECLARE_CALLBACK(void , onDefaultClick , () )
DECLARE_CALLBACK(void , onCtrlClick , () )
DECLARE_CALLBACK(void , onAltClick , () )
DECLARE_CALLBACK(void , onShiftClick , () )

Public Types

enum
BitmapMode {
  BitmapStretched 
  BitmapCentered 
}

Protected Types

enum
Modifier {
  ModifierNone 
  ModifierCtrl 
  ModifierAlt 
  ModifierShift 
  NumModifiers 
}
enum
State {
  NORMAL 
  HILIGHT 
  DEPRESSED 
  INACTIVE 
}

Protected Attributes

bool

Make control extents equal to bitmap size.

File name for bitmap.

bool

alpha masking

mTextures [NumModifiers]
bool

Allow switching out images according to modifier presses.

bool

Allow switching images according to mouse states.

Protected Static Functions

bool
_setAutoFitExtents(void * object, const char * index, const char * data)
bool
_setBitmap(void * object, const char * index, const char * data)

Public Functions

DECLARE_DESCRIPTION("A button <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> rendered entirely from <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">bitmaps.\n</a>" "The individual button states are represented with separate bitmaps." )

Called after any property of the object is changed in the world editor.

Occurs when this control performs its "action".

onRender(Point2I offset, const RectI & updateRect)

Called when this control is to render itself.

Called when this object is asked to sleep.

bool

Called when this object is asked to wake up returns true if it's actually awake at the end.

bool
pointInControl(const Point2I & parentCoordPoint)

This function will return true if the provided coordinates (wrt parent object) are within the bounds of this control.

setAutoFitExtents(bool state)
setBitmapHandles(GFXTexHandle normal, GFXTexHandle highlighted, GFXTexHandle depressed, GFXTexHandle inactive)

Public Static Functions

Detailed Description

A button control that uses bitmaps as its different button states.

Set 'bitmap' console field to base name of bitmaps to use. This control will

append '_n' for normal append '_h' for highlighted append '_d' for depressed append '_i' for inactive

If a bitmap cannot be found it will use the default bitmap to render.

Additionally, a bitmap button can be made to react to keyboard modifiers. These can be either CTRL/CMD, ALT, or SHIFT (but no combination of them.) To assign a different bitmap for a modifier state, prepend "_ctrl", _"alt", or "_shift" to the state postfix.

To implement different handlers for the modifier states, use the "onDefaultClick", "onCtrlClick", "onAltClick", and "onShiftClick" methods.

Callbacks

DECLARE_CALLBACK(void , onDefaultClick , () )

DECLARE_CALLBACK(void , onCtrlClick , () )

DECLARE_CALLBACK(void , onAltClick , () )

DECLARE_CALLBACK(void , onShiftClick , () )

Public Types

BitmapMode

Enumerator

BitmapStretched
BitmapCentered
typedef GuiButtonCtrl Parent 

Protected Types

Modifier

Enumerator

ModifierNone
ModifierCtrl
ModifierAlt
ModifierShift
NumModifiers
State

Enumerator

NORMAL
HILIGHT
DEPRESSED
INACTIVE

Protected Attributes

bool mAutoFitExtents 

Make control extents equal to bitmap size.

BitmapMode mBitmapMode 
String mBitmapName 

File name for bitmap.

bool mMasked 

alpha masking

Textures mTextures [NumModifiers]
bool mUseModifiers 

Allow switching out images according to modifier presses.

bool mUseStates 

Allow switching images according to mouse states.

On by default. Switch off when not needed as it otherwise results in a lot of costly texture loads.

Protected Functions

getCurrentModifier()

getState()

getTextureForCurrentState()

renderButton(GFXTexHandle & texture, const Point2I & offset, const RectI & updateRect)

Reimplemented by: GuiBitmapButtonTextCtrl

Protected Static Functions

_setAutoFitExtents(void * object, const char * index, const char * data)

_setBitmap(void * object, const char * index, const char * data)

Public Functions

GuiBitmapButtonCtrl()

DECLARE_CONOBJECT(GuiBitmapButtonCtrl )

DECLARE_DESCRIPTION("A button <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> rendered entirely from <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">bitmaps.\n</a>" "The individual button states are represented with separate bitmaps." )

inspectPostApply()

Reimplemented from: SimObject

onAction()

Reimplemented from: GuiControl

onRender(Point2I offset, const RectI & updateRect)

Reimplemented from: GuiControl

Reimplemented by: VEditorButton

onSleep()

Reimplemented from: GuiControl

onWake()

Reimplemented from: GuiControl

pointInControl(const Point2I & parentCoordPoint)

Reimplemented from: GuiControl

setAutoFitExtents(bool state)

setBitmap(const String & name)

setBitmapHandles(GFXTexHandle normal, GFXTexHandle highlighted, GFXTexHandle depressed, GFXTexHandle inactive)

Public Static Functions

initPersistFields()