Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
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.CommandsBAAVRHandLocomotion.HandLocomotionAction Dragengine.Commands.CommandsBAAVRMenuInput.MenuAction Dragengine.Commands.CommandsBAAVRTriggerInput.TriggerAction

Public Member Functions

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

Public Attributes

String pName

Detailed Description

Command carrying out a specific task.

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

Member Function Documentation

◆ analogAbsolute() [1/2]

void Dragengine.Commands.Command.analogAbsolute ( Binding binding,
float value )

Absolute input device axis position changed.

Version
1.35

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.
bindingBinding producing the event or null if unknown or generated.

Reimplemented in Dragengine.Commands.CommandsBAAMovement.Base.

References start(), and stop().

◆ analogAbsolute() [2/2]

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.CommandsBAAMovement.Base, Dragengine.Commands.CommandsBAAVRGrab.Base, and Dragengine.Commands.CommandsBAAVRTriggerInput.TriggerAction.

References start().

Referenced by withdraw().

◆ analogRelative() [1/2]

void Dragengine.Commands.Command.analogRelative ( Binding binding,
float value )

Relative input device axis position changed.

Version
1.35

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.
bindingBinding producing the event or null if unknown or generated.

Reimplemented in Dragengine.Commands.CommandsBAAMovement.Base.

References translateDescription().

◆ analogRelative() [2/2]

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.

Referenced by withdraw(), and withdraw().

◆ approach() [1/2]

void Dragengine.Commands.Command.approach ( )

User finger approached device button.

Version
1.28

Reimplemented in Dragengine.Commands.CommandsBAAVRTriggerInput.TriggerAction.

References start(), and stop().

Referenced by withdraw().

◆ approach() [2/2]

void Dragengine.Commands.Command.approach ( Binding binding)

User finger approached device button.

Version
1.35
Parameters
bindingBinding producing the event or null if unknown or generated.

◆ getDescription()

String Dragengine.Commands.Command.getDescription ( )

Description.

Referenced by getTranslateDescription().

◆ 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.

References getTranslateDescription().

Referenced by getTranslateDisplayName().

◆ getName()

String Dragengine.Commands.Command.getName ( )

Unique name.

References getName(), and setDescription().

Referenced by getName().

◆ 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.

References getDescription(), new(), and setDescription().

Referenced by getDisplayName().

◆ 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.

References getDisplayName().

Referenced by translateDisplayName().

◆ new() [1/2]

Command Dragengine.Commands.Command.new ( )

◆ new() [2/2]

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

Create command.

References setName().

◆ pulse() [1/2]

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.

References translateDisplayName().

Referenced by untouch(), and untouch().

◆ pulse() [2/2]

void Dragengine.Commands.Command.pulse ( Binding binding)

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

Version
1.35
Parameters
bindingBinding producing the event or null if unknown or generated.

References translateDescription().

◆ setDescription()

void Dragengine.Commands.Command.setDescription ( String 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.

References setTranslateDescription().

Referenced by setTranslateDisplayName().

◆ 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.

References pName.

Referenced by new(), Dragengine.Commands.CommandQuitGame.new(), Dragengine.Commands.CommandToggleConsole.new(), and setDescription().

◆ setTranslateDescription()

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

◆ 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.

References setDisplayName().

Referenced by Dragengine.Commands.CommandsBAAMovement.AnalogLookUD.analogAbsolute(), Dragengine.Commands.CommandScreenshot.getScreenshotCreator(), Dragengine.Commands.CommandQuitGame.new(), Dragengine.Commands.CommandToggleConsole.new(), and translateDisplayName().

◆ start() [1/2]

◆ start() [2/2]

void Dragengine.Commands.Command.start ( Binding binding)

Input device key or button has been pressed.

Version
1.35
Parameters
bindingBinding producing the event or null if unknown or generated.

Reimplemented in Dragengine.Commands.CommandsBAAInteract.Base, and Dragengine.Commands.CommandsBAAMovement.Base.

◆ stop() [1/2]

◆ stop() [2/2]

void Dragengine.Commands.Command.stop ( Binding binding)

Input device key or button has been released.

Version
1.35
Parameters
bindingBinding producing the event or null if unknown or generated.

Reimplemented in Dragengine.Commands.CommandsBAAInteract.Base, and Dragengine.Commands.CommandsBAAMovement.Base.

◆ touch() [1/2]

void Dragengine.Commands.Command.touch ( )

Input device button has been touched.

Version
1.6

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

References stop().

Referenced by withdraw().

◆ touch() [2/2]

void Dragengine.Commands.Command.touch ( Binding binding)

Input device button has been touched.

Version
1.35
Parameters
bindingBinding producing the event or null if unknown or generated.

References stop().

◆ translateDescription() [1/2]

String Dragengine.Commands.Command.translateDescription ( )

Translated command description using default TranslationManager.

Version
1.16

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

References translateDisplayName().

◆ 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.

Referenced by analogRelative(), and pulse().

◆ translateDisplayName() [1/2]

String Dragengine.Commands.Command.translateDisplayName ( )

Translated display name using default TranslationManager.

Version
1.16

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

References setTranslateDisplayName().

◆ 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.

References getTranslateDisplayName().

Referenced by pulse(), and translateDescription().

◆ untouch() [1/2]

void Dragengine.Commands.Command.untouch ( )

Input device button has been untouched.

Version
1.6

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

References pulse(), start(), and stop().

Referenced by withdraw().

◆ untouch() [2/2]

void Dragengine.Commands.Command.untouch ( Binding binding)

Input device button has been untouched.

Version
1.35
Parameters
bindingBinding producing the event or null if unknown or generated.

References pulse().

◆ withdraw() [1/2]

void Dragengine.Commands.Command.withdraw ( )

User finger withdrew from device button.

Version
1.28

Reimplemented in Dragengine.Commands.CommandsBAAVRTriggerInput.TriggerAction.

References analogRelative().

Referenced by withdraw().

◆ withdraw() [2/2]

void Dragengine.Commands.Command.withdraw ( Binding binding)

User finger withdrew from device button.

Version
1.35
Parameters
bindingBinding producing the event or null if unknown or generated.

References analogAbsolute(), analogRelative(), approach(), touch(), untouch(), and withdraw().

Member Data Documentation

◆ pName

String Dragengine.Commands.Command.pName

Referenced by new(), setDescription(), setName(), and stop().


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