Drag[en]gine Script Module DragonScript  1.21
Dragengine.Commands.Command Class Reference

Command carrying out a specific task. More...

Inheritance diagram for Dragengine.Commands.Command:
Dragengine.Commands.CommandQuitGame Dragengine.Commands.CommandScreenshot Dragengine.Commands.CommandToggleConsole Dragengine.Commands.CommandsBAAInteract.Base Dragengine.Commands.CommandsBAAMovement.Base Dragengine.Commands.CommandsBAAVRGrab.Base Dragengine.Commands.CommandsBAAVRMenuInput.MenuAction Dragengine.Commands.CommandsBAAVRTriggerInput.TriggerAction

Public Member Functions

void analogAbsolute (float value)
 Absolute input device axis position changed. More...
 
void analogRelative (float value)
 Relative input device axis position changed. More...
 
String getDescription ()
 Description. More...
 
String getDisplayName ()
 Display name or null. More...
 
String getName ()
 Unique name. More...
 
String getTranslateDescription ()
 Translation description or null. More...
 
String getTranslateDisplayName ()
 Translation display name or null. More...
 
Command new ()
 Create command. More...
 
Command new (String name, String description)
 Create command. More...
 
void pulse ()
 Convenience method calling start() and stop() in succession. More...
 
void setDescription (String description)
 Set description. More...
 
void setDisplayName (String displayName)
 Set display name or null. More...
 
void setName (String name)
 Set unique name of the command. More...
 
void setTranslateDescription (String translateName)
 Set translate description or null. More...
 
void setTranslateDisplayName (String translateName)
 Set translate display name or null. More...
 
void start ()
 Input device key or button has been pressed. More...
 
void stop ()
 Input device key or button has been released. More...
 
void touch ()
 Input device button has been touched. More...
 
String translateDescription ()
 Translated command description using default TranslationManager. More...
 
String translateDescription (TranslationManager translationManager)
 Translated command description. More...
 
String translateDisplayName ()
 Translated display name using default TranslationManager. More...
 
String translateDisplayName (TranslationManager translationManager)
 Translated display name. More...
 
void untouch ()
 Input device button has been untouched. More...
 

Detailed Description

Command carrying out a specific task.

Can be bound to player input events or used in widgets.

Member Function Documentation

◆ analogAbsolute()

void Dragengine.Commands.Command.analogAbsolute ( float  value)

Absolute input device axis position changed.

Axis keeps position until next event. Gamepad events typically send this method when the stick is pushed to a new position.

Parameters
valueNew axis position in the range -1 to 1.

Reimplemented in Dragengine.Commands.CommandsBAAVRTriggerInput.TriggerAction, Dragengine.Commands.CommandsBAAVRGrab.Base, and Dragengine.Commands.CommandsBAAMovement.Base.

◆ analogRelative()

void Dragengine.Commands.Command.analogRelative ( float  value)

Relative input device axis position changed.

Value is the change in the relative axis. It is reset to 0 right after sending the event. No event is sent for the reset. A typical device is mouse movement resulting in this method to be called.

Parameters
valueRelative axis position change in axis units. Caller is responsible to adjust the range to make different input devices match in magnitude.

Reimplemented in Dragengine.Commands.CommandsBAAMovement.Base.

◆ getDescription()

String Dragengine.Commands.Command.getDescription ( )

Description.

◆ getDisplayName()

String Dragengine.Commands.Command.getDisplayName ( )

Display name or null.

Version
1.16

Display name is used for EditBindingsPanel and other placers where commands have to be shown to the user in a UI. If null getName() has to be used.

◆ getName()

String Dragengine.Commands.Command.getName ( )

Unique name.

◆ getTranslateDescription()

String Dragengine.Commands.Command.getTranslateDescription ( )

Translation description or null.

Version
1.16

If not null use TranslationManager to get description. If null or no translation can be found getDescription() has to be used.

◆ getTranslateDisplayName()

String Dragengine.Commands.Command.getTranslateDisplayName ( )

Translation display name or null.

Version
1.16

If not null use TranslationManager to get display name. If null or no translation can be found getDisplayName() has to be used.

◆ new() [1/2]

Command Dragengine.Commands.Command.new ( )

Create command.

Reimplemented in Dragengine.Commands.CommandQuitGame.

◆ new() [2/2]

Command Dragengine.Commands.Command.new ( String  name,
String  description 
)

Create command.

◆ pulse()

void Dragengine.Commands.Command.pulse ( )

Convenience method calling start() and stop() in succession.

Used for example to run the command for different reasons than input handling.

◆ setDescription()

void Dragengine.Commands.Command.setDescription ( String  description)

Set description.

◆ setDisplayName()

void Dragengine.Commands.Command.setDisplayName ( String  displayName)

Set display name or null.

Version
1.16

Display name is used for EditBindingsPanel and other placers where commands have to be shown to the user in a UI. If null getName() has to be used.

◆ setName()

void Dragengine.Commands.Command.setName ( String  name)

Set unique name of the command.

Allowed are only upper and lower case letters, numbers and underscores.

◆ setTranslateDescription()

void Dragengine.Commands.Command.setTranslateDescription ( String  translateName)

Set translate description or null.

Version
1.16

If not null use TranslationManager to get display name. If null or no translation can be found getDescription() has to be used.

◆ setTranslateDisplayName()

void Dragengine.Commands.Command.setTranslateDisplayName ( String  translateName)

Set translate display name or null.

Version
1.16

If not null use TranslationManager to get display name. If null or no translation can be found getDisplayName() has to be used.

◆ start()

◆ stop()

◆ touch()

void Dragengine.Commands.Command.touch ( )

Input device button has been touched.

Version
1.6

Reimplemented in Dragengine.Commands.CommandsBAAVRTriggerInput.TriggerAction, and Dragengine.Commands.CommandsBAAVRMenuInput.MenuAction.

◆ translateDescription() [1/2]

String Dragengine.Commands.Command.translateDescription ( )

Translated command description using default TranslationManager.

Version
1.16

Same as translateDescription(TranslationManager) using TranslationManager.get() .

◆ translateDescription() [2/2]

String Dragengine.Commands.Command.translateDescription ( TranslationManager  translationManager)

Translated command description.

Version
1.16

Tries first to translate using translationManager. If translationManager is null or no translation is found tries translate using EngineTranslations. If no translation is found returns getDescription().

Returns UTF-8 string.

Parameters
translationManagerTranslationManager to use or null.

◆ translateDisplayName() [1/2]

String Dragengine.Commands.Command.translateDisplayName ( )

Translated display name using default TranslationManager.

Version
1.16

Same as translateDisplayName(TranslationManager) using TranslationManager.get() .

◆ translateDisplayName() [2/2]

String Dragengine.Commands.Command.translateDisplayName ( TranslationManager  translationManager)

Translated display name.

Version
1.16

Tries first to translate using translationManager. If translationManager is null or the transation can not be found tries translate using EngineTranslations. If this does not provide a translation returns getDisplayName(). If getDisplayName() is null returns getName().

Returns UTF-8 string.

Parameters
translationManagerTranslationManager to use or null.

◆ untouch()

void Dragengine.Commands.Command.untouch ( )

Input device button has been untouched.

Version
1.6

Reimplemented in Dragengine.Commands.CommandsBAAVRTriggerInput.TriggerAction, and Dragengine.Commands.CommandsBAAVRMenuInput.MenuAction.


The documentation for this class was generated from the following file: