User Tools

Site Tools


dragengine:modules:dragonscript:behavior_vrhandaction

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dragengine:modules:dragonscript:behavior_vrhandaction [2024/03/14 16:44] dragonlorddragengine:modules:dragonscript:behavior_vrhandaction [2025/03/13 17:17] (current) dragonlord
Line 1: Line 1:
 {{tag>dragonscript behavior}} {{tag>dragonscript behavior}}
 <WRAP youarehere> <WRAP youarehere>
-[[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[abstractions#behavior_elementsquick_and_easy_development|Behavior Elements: Quick and Easy Development]] >> **ECBehaviorVRHandAction**+[[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[dragengine:modules:dragonscript:abstractions|Abstraction Layers: How you want to build your Game]] >> [[dragengine:modules:dragonscript:behavior_elements|Behavior Elements]] >> **ECBehaviorVRHandAction**
 </WRAP> </WRAP>
  
Line 21: Line 21:
 ====== Element Class Properties ====== ====== Element Class Properties ======
  
-Element class properties have the prefix **vrHandAction.** or **vrHandAction(id).** if id is not empty.+Element class properties have the prefix ''vrHandAction.'' or ''vrHandAction(id).'' if id is not empty.
  
 Thie behavior adds no element class properties. Thie behavior adds no element class properties.
  
 Using this behavior in code you should call ECBehaviorVRHandAction.setActionFactory() to set the factory creating the initial action for the hand to use. By default an instance of #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1BaseVRHandAction.html,BaseVRHandAction~@# is used. Using this behavior in code you should call ECBehaviorVRHandAction.setActionFactory() to set the factory creating the initial action for the hand to use. By default an instance of #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1BaseVRHandAction.html,BaseVRHandAction~@# is used.
 +
 +====== Events ======
 +
 +This behavior has no events.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
Line 37: Line 41:
 ====== Persistency ====== ====== Persistency ======
  
-Saves these parameters: +This behavior does support element class to be persistable (setPersistable).
-  * Active Action+
  
 ====== API Documentation ====== ====== API Documentation ======
Line 44: Line 47:
 #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorVRHandAction.html,ECBehaviorVRHandAction~@#. #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorVRHandAction.html,ECBehaviorVRHandAction~@#.
  
-Since DragonScript Module Version **1.10**+Since DragonScript Module Version ''1.10''
  
 ====== Use Cases ====== ====== Use Cases ======
Line 134: Line 137:
   end   end
 end end
 +</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='ECBehaviorVRPlayspace'/>
 +  <behavior type='ECBehaviorVRHand' id='right'/>
 +  <behavior type='ECBehaviorVRHand' id='left'/>
 +  <behavior type='ECBehaviorVRHandPointAt' id='right'>
 +    <string name='vrHand'>right</string>
 +  </behavior>
 +  <behavior type='ECBehaviorVRHandPointAt' id='left'>
 +    <string name='vrHand'>left</string>
 +  </behavior>
 +  
 +  <behavior type='ECBehaviorVRHandAction' id='right'>
 +    <!-- required: use vr hand with id. -->
 +    <string name='vrHand'>right</string>
 +    
 +    <!-- set element properties. omit property prefix if used inside behavior tag -->
 +    <string name='.name'>value</string>
 +  </behavior>
 +  
 +  <behavior type='ECBehaviorVRHandAction' id='left'>
 +    ...
 +  </behavior>
 +</elementClass>
 </code> </code>
  
dragengine/modules/dragonscript/behavior_vrhandaction.1710434671.txt.gz · Last modified: 2024/03/14 16:44 by dragonlord