Drag[en]gine Script Module DragonScript  1.12
Dragengine.Scenery.ECBehaviorInteractPrompt Class Reference

Behavior adding support to elements to show interact prompt to player. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorInteractPrompt:
Dragengine.Scenery.DefaultECBehavior Dragengine.Scenery.ECBehavior Dragengine.Scenery.BehaviorCompatiblePersistency

Classes

class  Instance
 Behavior instance. More...
 

Public Member Functions

ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance. More...
 
ECPStringList getBones ()
 List of bones to restrict the prompt to. More...
 
ECPString getCommand ()
 Command. More...
 
ECPUnicodeString getDescription ()
 Description. More...
 
ECPBoolean getEnabled ()
 Prompt is enabled. More...
 
ECPImage getImage ()
 Image. More...
 
ECPString getStyle ()
 Style. More...
 
ECPUnicodeString getVerb ()
 Verb. 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)
 
- 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...
 

Static Public Member Functions

static Array getAllBehaviorsIn (BehaviorElementClass eclass)
 Get list of all behaviors in element. More...
 
static Array getAllEnabledInstancesIn (BehaviorElement element)
 Get list of all enabled instances in element. More...
 
static Array getAllInstancesIn (BehaviorElement element)
 Get list of all instances in element. More...
 
static ECBehaviorInteractPrompt getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent. More...
 
static ECBehaviorInteractPrompt getBehaviorIn (BehaviorElementClass eclass, String id)
 Get behavior with id in element class or null if absent. More...
 
static Instance getInstanceIn (BehaviorElement element)
 Get instance in element or null if absent. More...
 
static Instance getInstanceIn (BehaviorElement element, String id)
 Get instance with id in element 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...
 

Detailed Description

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:

Member Function Documentation

◆ createInstance()

ECBehaviorInstance Dragengine.Scenery.ECBehaviorInteractPrompt.createInstance ( BehaviorElement  element)

Create Behavior instance.

Implements Dragengine.Scenery.ECBehavior.

◆ getAllBehaviorsIn()

static Array Dragengine.Scenery.ECBehaviorInteractPrompt.getAllBehaviorsIn ( BehaviorElementClass  eclass)
static

Get list of all behaviors in element.

Returns list contains ECBehaviorInteractPrompt behaviors in the order they have been created in the element.

◆ getAllEnabledInstancesIn()

static Array Dragengine.Scenery.ECBehaviorInteractPrompt.getAllEnabledInstancesIn ( BehaviorElement  element)
static

Get list of all enabled instances in element.

Returns list contains ECBehaviorInteractPrompt.Instance instances in the order they have been created in the element.

◆ getAllInstancesIn()

static Array Dragengine.Scenery.ECBehaviorInteractPrompt.getAllInstancesIn ( BehaviorElement  element)
static

Get list of all instances in element.

Returns list contains ECBehaviorInteractPrompt.Instance instances in the order they have been created in the element.

◆ getBehaviorIn() [1/2]

static ECBehaviorInteractPrompt Dragengine.Scenery.ECBehaviorInteractPrompt.getBehaviorIn ( BehaviorElementClass  eclass)
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.

◆ getBehaviorIn() [2/2]

static ECBehaviorInteractPrompt Dragengine.Scenery.ECBehaviorInteractPrompt.getBehaviorIn ( BehaviorElementClass  eclass,
String  id 
)
static

Get behavior with id in element class or null if absent.

Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorInteractPrompt with specific identifier.

◆ getBones()

ECPStringList Dragengine.Scenery.ECBehaviorInteractPrompt.getBones ( )

List of bones to restrict the prompt to.

◆ getCommand()

ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.getCommand ( )

Command.

◆ getDescription()

ECPUnicodeString Dragengine.Scenery.ECBehaviorInteractPrompt.getDescription ( )

Description.

◆ getEnabled()

ECPBoolean Dragengine.Scenery.ECBehaviorInteractPrompt.getEnabled ( )

Prompt is enabled.

◆ getImage()

ECPImage Dragengine.Scenery.ECBehaviorInteractPrompt.getImage ( )

Image.

◆ getInstanceIn() [1/2]

static Instance Dragengine.Scenery.ECBehaviorInteractPrompt.getInstanceIn ( BehaviorElement  element)
static

Get instance in element or null if absent.

Use this method to check if a particular BehaviorElement contains a behavior instance of type ECBehaviorInteractPrompt.Instance . If more than one instance is present returns the first instance.

◆ getInstanceIn() [2/2]

static Instance Dragengine.Scenery.ECBehaviorInteractPrompt.getInstanceIn ( BehaviorElement  element,
String  id 
)
static

Get instance with id in element or null if absent.

Use this method to check if a particular BehaviorElement contains a behavior instance of type ECBehaviorInteractPrompt.Instance with specific identifier.

◆ getStyle()

ECPString Dragengine.Scenery.ECBehaviorInteractPrompt.getStyle ( )

Style.

◆ getVerb()

ECPUnicodeString Dragengine.Scenery.ECBehaviorInteractPrompt.getVerb ( )

Verb.

◆ getVideo()

ECPVideo Dragengine.Scenery.ECBehaviorInteractPrompt.getVideo ( )

Video.

◆ instance()

Instance Dragengine.Scenery.ECBehaviorInteractPrompt.instance ( BehaviorElement  element)

Get instance in element from owner element class.

◆ new() [1/4]

ECBehaviorInteractPrompt Dragengine.Scenery.ECBehaviorInteractPrompt.new ( BehaviorElementClass  eclass)

Create behavior element class.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ new() [2/4]

ECBehaviorInteractPrompt Dragengine.Scenery.ECBehaviorInteractPrompt.new ( BehaviorElementClass  eclass,
String  id 
)

Create default composeable behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ new() [3/4]

ECBehaviorInteractPrompt Dragengine.Scenery.ECBehaviorInteractPrompt.new ( BehaviorElementClass  eclass,
String  id,
String  subID 
)

◆ new() [4/4]

ECBehaviorInteractPrompt Dragengine.Scenery.ECBehaviorInteractPrompt.new ( BehaviorElementClass  eclass,
String  id,
String  subID,
String  prefix 
)

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