Drag[en]gine Script Module DragonScript
1.23
|
Behavior adding support to elements to show interact prompt to player. More...
Classes | |
class | Instance |
Behavior instance. More... | |
Public Member Functions | |
ECPStringList | getAlternativeCommands () |
Alternative commands. More... | |
ECPStringList | getBones () |
List of bones to restrict the prompt to. More... | |
ECPString | getCommand () |
Command. More... | |
ECPUnicodeString | getDescription () |
Description. More... | |
ECPString | getDescriptionTranslate () |
Description translated by active language. More... | |
ECPBoolean | getEnabled () |
Prompt is enabled. More... | |
ECPImage | getImage () |
Image. More... | |
ECPFloat | getMaximumDistance () |
Maximum distance to show interact prompt for when looking at it. More... | |
ECPString | getSettings () |
Optional settings to modify custom prompt widget display. More... | |
ECPString | getStyle () |
Style. More... | |
TranslationManager | getTranslationManager () |
Translation manager or null. More... | |
ECPUnicodeString | getVerb () |
Verb. More... | |
ECPString | getVerbTranslate () |
Verb translated by active language. More... | |
ECPVideo | getVideo () |
Video. More... | |
Instance | instance (BehaviorElement element) |
Get instance in element from owner element class. More... | |
ECBehaviorInteractPrompt | new (BehaviorElementClass eclass) |
Create behavior element class. More... | |
ECBehaviorInteractPrompt | new (BehaviorElementClass eclass, String id) |
Create default composeable behavior. More... | |
ECBehaviorInteractPrompt | new (BehaviorElementClass eclass, String id, String subID) |
ECBehaviorInteractPrompt | new (BehaviorElementClass eclass, String id, String subID, String prefix) |
void | setTranslationManager (TranslationManager manager) |
Set translation manager or null. More... | |
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
void | assignInstanceIndex (int instanceIndex) |
Assign instance index. More... | |
void | dispose () |
Dispose of behavior. More... | |
String | getBehaviorID () |
Unique identifier of behavior. More... | |
String | getID () |
Identifier. More... | |
int | getInstanceIndex () |
Instance index. More... | |
void | loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance) |
Load instance data of another behavior. More... | |
bool | supportsBehaviorID (String identifier) |
Behavior supports loading instance data of another behavior. More... | |
Public Member Functions inherited from Dragengine.Scenery.ECBehavior | |
ECBehaviorInstance | createInstance (BehaviorElement element) |
Create Behavior instance. More... | |
Static Public Member Functions | |
static ECBehaviorInteractPrompt | getBehaviorIn (BehaviorElementClass eclass) |
Get behavior in element class or null if absent. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
void | setBehaviorID (String identifier) |
Set behavior identifier. More... | |
void | useClassNameAsBehaviorID () |
Set behavior identifier to "<class-name>:<identifier>". More... | |
void | useFullyQualifiedClassNameAsBehaviorID () |
Set behavior identifier to "<fully-qualified-class-name>:<identifier>". More... | |
Behavior adding support to elements to show interact prompt to player.
This is a passive behavior storing the information used by player prompt behaviors to show to the player what he can do with the element for example when looking at it.
The promp information composes of an image/video, style, verb, description and command. Not all information is shown by player prompt behaviors. Typically the image/video and verb is shown sometimes only the image/video. If multiple interactions are possible the command is usually also shown. The description can be used if the player needs some more information that can not be easily given using an image/video or a simple interact verb. The style is an optional information can be be used by the player prompt behavior to tint the image/video, verb text or even the description. This can be used to tell the player additional hints like if the interaction has potential caveats or is currently not possible to be done. The meaning of the style value depends on the prompt display widget used. A typical use of style is to be used as suffix for the widget designer selector.
The player prompt behavior determines where the image/video, verb, command and description text is shown.
This behavior has an enabled parameter. This can be used to temporarily disable the interact prompt for example to enable it when certain conditions are met or if multiple interact prompts are used for the same element. This allows to set them all up and enabling only the active one.
The command parameter is the name of the command as present in the CommandManager used by the player interact prompt display. If found the bindings used to trigger this command are shown or the command name whever the prompt display decides to use.
Prompts are typically used with collision testing for example ECBehaviorLookAt and likewise. In this situation it can be useful to assign prompts to individual areas of a collider for example using hit bone name as produced by collision tests. For this use case the bones parameter can be used. If this parameter is an not an empty list this prompt shall only be considered if the hit bone is included in the list.
This behavior can be used multiple times on an element to add different interaction prompts. Use the behavior identifier to tell them apart.
Default property prefix is "interactPrompt{(id)}."
Supports these properties:
ECPStringList Dragengine.Scenery.ECBehaviorInteractPrompt.getAlternativeCommands | ( | ) |
Alternative commands.
|
static |
Get behavior in element class or null if absent.
Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorInteractPrompt.
ECPStringList Dragengine.Scenery.ECBehaviorInteractPrompt.getBones | ( | ) |
List of bones to restrict the prompt to.
ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.getCommand | ( | ) |
Command.
ECPUnicodeString Dragengine.Scenery.ECBehaviorInteractPrompt.getDescription | ( | ) |
Description.
ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.getDescriptionTranslate | ( | ) |
Description translated by active language.
ECPBoolean Dragengine.Scenery.ECBehaviorInteractPrompt.getEnabled | ( | ) |
Prompt is enabled.
ECPImage Dragengine.Scenery.ECBehaviorInteractPrompt.getImage | ( | ) |
Image.
ECPFloat Dragengine.Scenery.ECBehaviorInteractPrompt.getMaximumDistance | ( | ) |
Maximum distance to show interact prompt for when looking at it.
ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.getSettings | ( | ) |
Optional settings to modify custom prompt widget display.
ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.getStyle | ( | ) |
Style.
TranslationManager Dragengine.Scenery.ECBehaviorInteractPrompt.getTranslationManager | ( | ) |
Translation manager or null.
ECPUnicodeString Dragengine.Scenery.ECBehaviorInteractPrompt.getVerb | ( | ) |
Verb.
ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.getVerbTranslate | ( | ) |
Verb translated by active language.
ECPVideo Dragengine.Scenery.ECBehaviorInteractPrompt.getVideo | ( | ) |
Video.
Instance Dragengine.Scenery.ECBehaviorInteractPrompt.instance | ( | BehaviorElement | element | ) |
Get instance in element from owner element class.
ECBehaviorInteractPrompt Dragengine.Scenery.ECBehaviorInteractPrompt.new | ( | BehaviorElementClass | eclass | ) |
Create behavior element class.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
ECBehaviorInteractPrompt Dragengine.Scenery.ECBehaviorInteractPrompt.new | ( | BehaviorElementClass | eclass, |
String | id | ||
) |
Create default composeable behavior.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
ECBehaviorInteractPrompt Dragengine.Scenery.ECBehaviorInteractPrompt.new | ( | BehaviorElementClass | eclass, |
String | id, | ||
String | subID | ||
) |
ECBehaviorInteractPrompt Dragengine.Scenery.ECBehaviorInteractPrompt.new | ( | BehaviorElementClass | eclass, |
String | id, | ||
String | subID, | ||
String | prefix | ||
) |
void Dragengine.Scenery.ECBehaviorInteractPrompt.setTranslationManager | ( | TranslationManager | manager | ) |
Set translation manager or null.
ECPStringList Dragengine.Scenery.ECBehaviorInteractPrompt.pAlternativeCommands |
ECPStringList Dragengine.Scenery.ECBehaviorInteractPrompt.pBones |
ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.pCommand |
ECPUnicodeString Dragengine.Scenery.ECBehaviorInteractPrompt.pDescription |
ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.pDescriptionTranslate |
ECPBoolean Dragengine.Scenery.ECBehaviorInteractPrompt.pEnabled |
ECPImage Dragengine.Scenery.ECBehaviorInteractPrompt.pImage |
ECPFloat Dragengine.Scenery.ECBehaviorInteractPrompt.pMaximumDistance |
ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.pSettings |
ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.pStyle |
TranslationManager Dragengine.Scenery.ECBehaviorInteractPrompt.pTranslationManager |
ECPUnicodeString Dragengine.Scenery.ECBehaviorInteractPrompt.pVerb |
ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.pVerbTranslate |
ECPVideo Dragengine.Scenery.ECBehaviorInteractPrompt.pVideo |