{{tag>motioncapture democap behavior}}
[[:start|Start Page]] >> [[main|DEMoCap: Drag[en]gine Motion Capture]] >> [[democap:elementclasses|XML Element Classes]] >> ** ECBGrabbedEnableCamera **
====== ECBGrabbedEnableCamera ======
Behavior adding support to enable camera if grabbed by actor.
====== Instance Counts ======
This element behavior can be present multiple times in a BehaviorElement. In this case use a unique identifier to distinguish the individual behavior instances.
====== Element Class Properties ======
Element class properties have the prefix ''grabbedEnableCamera.'' or ''grabbedEnableCamera({id}).'' if id is not empty.
====== Events ======
This behavior has no events.
====== Conversation Commands ======
This behavior adds no conversation commands.
====== Conversation Conditions ======
This behavior adds no conversation conditions.
====== Behavior Tree Actions ======
This behavior adds no behavior tree actions.
====== Behavior Tree Conditions ======
This behavior adds no behavior tree conditions.
====== Required Behaviors ======
* [[dragengine:modules:dragonscript:behavior_grabspot|ECBehaviorGrabSpot]]
* [[behavior_ecbrenderablecamera|ECBRenderableCamera]]
====== Optional Behaviors ======
This behavior does not support optional behaviors.
====== API Documentation ======
Since DEMoCap Version ''1.3''
====== Use Cases ======
* Enable renderable camera behavior if actor grabs object.
====== Element Class Example ======
class MyElement extends BehaviorElementClass
public var ECBehaviorComponent component
public var ECBehaviorCollider collider
public var ECBehaviorGrabSpot grabSpot
public var ECBehaviorCamera camera
public var ECBehaviorDynamicSkin dynamicSkin
public var ECBehaviorRenderablePanel renderablePanel
public var ECBRenderableCamera renderableCamera
public var ECBGrabbedEnableCamera grabbedEnableCamera
func new()
component = ECBehaviorComponent.new(this)
collider = ECBehaviorCollider.new(this, component)
grabSpot = ECBehaviorGrabSpot.new(this, collider)
grabSpot.getAttachTouchCollider().getPosition().setVector(Vector.new(0, 0, 0.1))
camera = ECBehaviorCamera.new(this, camera)
dynamicSkin = ECBehaviorDynamicSkin.new(this, component)
renderablePanel = ECBehaviorRenderablePanel.new(this, dynamicSkin)
renderablePanel.getRenderable().setValue("board")
renderablePanel.getSize().setPoint(Point.new(512, 256))
renderablePanel.getGuiTheme().setPath("/content/ui/adboard.guitheme.xml")
renderableCamera = ECBRenderableCamera.new(this, renderablePanel, camera)
grabbedEnableCamera = ECBGrabbedEnableCamera.new(this, grabSpot, renderableCamera)
end
end
====== Behavior Factory ======
Using element class supporting adding behaviors the behavior can be added like this (again create an example which creates a valid element class):
board
second
====== Live Examples ======