User Tools

Site Tools


dragengine:modules:dragonscript:behavior_vrhandpointedat

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
dragengine:modules:dragonscript:behavior_vrhandpointedat [2024/03/14 16:57] dragonlorddragengine:modules:dragonscript:behavior_vrhandpointedat [2025/03/12 21:31] (current) dragonlord
Line 14: Line 14:
  
 ====== Instance Counts ====== ====== Instance Counts ======
-This behavior can be used only once on an element. The behavior always has identifier empty string.+ 
 +This behavior can be used only once on an element.
  
 ====== Element Class Properties ====== ====== Element Class Properties ======
-Element class properties have the prefix **vrHandPointedAt.**.+ 
 +Element class properties have the prefix ''vrHandPointedAt.'' .
  
 This behavior defines no element class properties. This behavior defines no element class properties.
 +
 +====== Events ======
 +
 +===== handStartsPointingAt =====
 +
 +Hand starts pointing at element.
 +
 +===== handStopsPointingAt =====
 +
 +Hand stops pointing at element.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
 +
 This behavior does not required other behaviors to be present. This behavior does not required other behaviors to be present.
  
 ====== Optional Behaviors ====== ====== Optional Behaviors ======
 +
 This behavior does not support optional behaviors. This behavior does not support optional behaviors.
  
 ====== Persistency ====== ====== Persistency ======
 +
 This behavior does support element class to be persistable (setPersistable). This behavior does support element class to be persistable (setPersistable).
- 
-Saves the list of [[behavior_vrhandpointat|ECBehaviorVRHandPointAt]] pointing at the element. 
- 
-====== Events ====== 
-This behavior supports adding listeners. These events can be received: 
- 
-===== handStartsPointingAt ===== 
-[[behavior_vrhandpointat|ECBehaviorVRHandPointAt]] starts pointing at object. Event contains [[behavior_vrhandpointat|ECBehaviorVRHandPointAt]] pointing at object. 
- 
-===== handStopsPointingAt ===== 
-[[behavior_vrhandpointat|ECBehaviorVRHandPointAt]] stops pointing at object. Event contains [[behavior_vrhandpointat|ECBehaviorVRHandPointAt]] no more pointing at object. 
- 
  
 ====== API Documentation ====== ====== API Documentation ======
 #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorVRHandPointedAt.html,ECBehaviorVRHandPointedAt~@#. #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorVRHandPointedAt.html,ECBehaviorVRHandPointedAt~@#.
  
-Since DragonScript Module Version **1.7**+Since DragonScript Module Version ''1.7''
  
 ====== Use Cases ====== ====== Use Cases ======
 +
   * Show outline and interact prompts if player points at object.   * Show outline and interact prompts if player points at object.
   * For NPCs to react to player (or other actors) pointing at them (for example looking back at player).   * For NPCs to react to player (or other actors) pointing at them (for example looking back at player).
Line 66: Line 70:
 end end
 </code> </code>
 +
 +====== Behavior Factory ======
 +
 +Using element class supporting adding behaviors the behavior can be added like this:
 +<code xml>
 +<?xml version='1.0' encoding='UTF-8'?>
 +<elementClass name='MyClass' class='GenericBehaviorElement'>
 +  <behavior type='ECBehaviorVRHandPointedAt'>
 +    <!-- set element properties. omit property prefix if used inside behavior tag -->
 +    <string name='.name'>value</string>
 +  </behavior>
 +</elementClass>
 +</code>
 +
 +====== Live Examples ======
 +
 +  * [[https://github.com/LordOfDragons/deexamples|DEExamples Repository]]
 +
dragengine/modules/dragonscript/behavior_vrhandpointedat.txt · Last modified: 2025/03/12 21:31 by dragonlord