# Behaviors Changes

#### Converted 2D/3D behaviors to "mixed" behaviors

Several behaviors had a dedicated 2D and 3D variant. Such behaviors have been cleaned up and replaced by a mixed behavior providing a 2D or 3D implementation based on the node attached to. The 2D and 3D specific behaviors have been deprecated, a solution conversion will automatically convert existing Scene Composer solutions.

Affected behaviors:

<div class="contents" id="bkmrk-arcalignbehaviorbase"><div class="contents"><div class="textblock">- ArcAlignBehaviorBase2D deprecated, replaced by [ArcAlignBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_arc_align_behavior.html "Base Class. 2D Class aligns child nodes in a circular layout. Provides properties for the radius...")
- TouchIndicationBehavior2D and TouchIndicationBehavior3D deprecated, replaced by [TouchIndicationBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_touch_indication_behavior.html "changes the position of a node in the scene so the node's origin appears on the screen under the curr...")
- PositionProcessValueBehavior2D and PositionProcessValueBehavior3D deprecated, replaced by PositionProcessValueBehavior 
    - property TranslationAxis has been renamed to TranslationAxis2D, a new property TranslationAxis3D has been introduced
- RotateProcessValueBehavior2D and RotateProcessValueBehavior3D deprecated, replaced by RotateProcessValueBehavior 
    - property RotationAxis added
- ScaleProcessValueBehavior2D deprecated, replaced by ScaleProcessValueBehavior 
    - property IsScalingAlongXEnabled has been renamed to ScaleAlongX
    - property IsScalingAlongYEnabled has been renamed to ScaleAlongY
    - new property ScaleAlongZ added
    - property VectorXY has been renamed to ScaleVector2D
    - new property ScaleVector3D added
- TranslateProcessValueBehavior2D and TranslateProcessValueBehavior3D deprecated, replaced by TranslateProcessValueBehavior 
    - property VectorXY (Vector2) has been replaced by MultipliedVector (Vector3)
- TrackPositionProcessValueBehavior2D and TrackPositionProcessValueBehavior3D deprecated, replaced by [TrackPositionProcessValueBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_track_position_process_value_behavior.html "Translates drag events along a horizontal or vertical track into values in normalized range (0...")
- AlphaProcessValueBehavior2D and AlphaProcessValueBehavior3D deprecated, replaced by [AlphaProcessValueBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_alpha_process_value_behavior.html "Expects a Float value as a ProcessValueEvent and sets the Alpha value by the received value...")
- ColorActionBehavior2D deprecated, replaced by [ColorActionBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_color_action_behavior.html "Sets the color of a 2D node with a Color effect attached (e.g. BitmapBrushColorBlend or SolidColorBru...")
- EffectColorBehavior2D deprecated, replaced by [EffectColorBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_effect_color_behavior.html "Sets the color of a 2D node with a Color effect attached (e.g. BitmapBrushColorBlend or SolidColorBru...")
- ImageActionBehavior2D deprecated, replaced by [ImageActionBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_image_action_behavior.html "When triggered by an InvokeActionEvent, sets an Image to a Render Node.")
    - property Texture has been added
- SetImageBehavior2D deprecated, replaced by [SetImageBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_set_image_behavior.html "Sets the Image of a Render Node and provides the Image as a property for Controls.")
    - new property Textures added
- TextBehavior2D deprecated, replaced [TextBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_text_behavior.html "TextBehavior modifies the Text of a TextNode or CanvasText and provides the Text as property for Cont...")
- ZoomProcessValueBehavior2D deprecated, replaced by [ZoomProcessValueBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_zoom_process_value_behavior.html "Expects a Float value between 0 and 1 (inclusive) as an event. Applies scale and alpha on children of...").
- ScrollbarBehavior2D and ScrollbarBehavior3D deprecated, replaced by [ScrollbarBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_scrollbar_behavior.html "ScrollbarBehavior Reflects the position of the scrollable behavior. Eg. ListBehavior2D.")
- SwitchActionBehavior2D deprecated, replaced by [SwitchActionBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_switch_action_behavior.html "If invoked by a TriggerBehavior, enables/disables Child nodes corresponding to the value and the beha...")
- SwitchImageProcessValueBehavior2D deprecated, replaced by [SwitchImageProcessValueBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_switch_image_process_value_behavior.html "Sets an image on a Render Node based on an float index received as ProcessValueEvent.")
    - property RenderNode has been renamed to TargetNode
    - new property Textures added
- SwitchRangeProcessValueBehavior2D deprecated, replaced by [SwitchRangeProcessValueBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_switch_range_process_value_behavior.html "Enables/Disables Child nodes corresponding to the received value and the behavior settings...")

</div></div></div>Further changes:

<div class="contents" id="bkmrk-constructor-clipping"><div class="contents"><div class="textblock">- Constructor ClippingSetterTraverser(const Candera::Rectangle&amp; clippingArea, Candera::Node2D&amp; node) has been deprecated 
    - Please use ClippingSetterTraverser(const Candera::Rectangle&amp; clippingArea, Candera::AbstractNodePointer&amp; node) instead
- [PropertyProviderBehaviorBase](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_property_provider_behavior_base.html "[PropertyProviderBehaviorBase_Declaration]"): properties Texture, Appearance, Value have been added

---

</div></div></div>#### ControlTouchSession considers Camera for sorting

In the past the camera was not considered by the touch handling. This resulted in ambiguous touched controls.

The [ControlTouchSession](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_control_touch_session.html "The ControlTouchSession handles TouchEvents and emits several, more specific Events like the HoveredE...") has to sort behaviors according their "visual" order to assure, that touch inputs are forwarded to the "nearest" touchable behaviors. For this purpose a sub-struct [ControlTouchSession::TouchedBehavior](http://dev.doc.cgistudio.at/APILINK/struct_cgi_studio_control_1_1_control_touch_session_1_1_touched_behavior.html "Structure to keep together a behavior and a camera for touch handling. The camera is required for the...") has been introduced. The camera will be used to retrieve the according Candera::RenderTarget. Consequently HW layer order, SW Layer order, surface id and camera sequence number are considered during sorting of behaviors.

Each behavior-camera pair will be treated separately, thus a behavior rendered by two cameras will be distinguished for each camera.

Beside the internal handling in the [ControlTouchSession](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_control_touch_session.html "The ControlTouchSession handles TouchEvents and emits several, more specific Events like the HoveredE...") also the touch related events (TouchEvent, [ClickEvent](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_click_event.html "ClickEvent Input Event generated from ControlTouchSession and dispatched from the clicked Control..."), [PressedEvent](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_pressed_event.html "PressedEvent Input Event generated from ControlTouchSession and dispatched from the pressed Control..."), [DragDropEvent](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_drag_drop_event.html "DragDropEvent Input Event which is yet not used from the ControlTouchSession.") and [HoverEvent](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_hover_event.html "HoverEvent Input Event generated from ControlTouchSession and dispatched from the hovered Control...")) have been extended by a touched camera. The old constructors have been deprecated. Please use the one with the additional camera instead.

For the same reason also [KeyboardFocusManager](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_keyboard_focus_manager.html "The KeyboardFocusManager is the central point for managing the keyboard focus. Custom implementation ...") has been enhanced by new methods [KeyboardFocusManager::SetFocused(const Candera::AbstractNodePointer&amp; node, const Candera::AbstractCameraPointer&amp; camera)](http://dev.doc.cgistudio.at/APILINK/group___behaviors_common.html#ga68c8da301430bf57ffa877113d36c5cb) and [KeyboardFocusManager::GetFocusedCamera()](http://dev.doc.cgistudio.at/APILINK/group___behaviors_common.html#ga7c69f0c94f3bfc4b5ddff20d732bd299). Please also use the SetFocused with the extra camera parameter in future.

<div class="contents" id="bkmrk-"><div class="contents"><div class="textblock">---

</div></div></div>#### Implementation of geometric and tab order focus navigation

A new event class [KeyboardFocusNavigationEvent](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_keyboard_focus_navigation_event.html "Send the KeyboardFocusNavigationEvent to the keyboard focused control to change the keyboard focus ac...") has been added to reflect navigation input like a rotary input to navigate between the visual controls. Furthermore the controls will use the new RegisterNavigation and DeregisterNavigation interface of the [KeyboardFocusManager](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_keyboard_focus_manager.html "The KeyboardFocusManager is the central point for managing the keyboard focus. Custom implementation ...") to register themselves for the navigation.

<div class="contents" id="bkmrk--0"><div class="contents"><div class="textblock">---

</div></div></div>#### An interface has been added to extend the ControlTouchSession by gesture detectors

The detection of Click, press/release and drag&amp;drop has been transformed into such a gesture detector. Futhermore, a gesture detector for swipe/flick and a gesture detector for transformations (rotate, pan and pinch) has been added.

<div class="contents" id="bkmrk--1"><div class="contents"><div class="textblock">---

</div></div></div>#### Further minor changes

<div class="contents" id="bkmrk-the-return-value-of-"><div class="contents"><div class="textblock">- The return value of EventToMessageBridge::PostAsMessage has been changed to an enum type to reflect the exact outcome of the Post and to reduce the logging to errors only.
- A Getter/Setter interface has been added to the [ControlTouchSession](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_control_touch_session.html "The ControlTouchSession handles TouchEvents and emits several, more specific Events like the HoveredE...") to enable/disable the consumption of touch events by the [ControlTouchSession](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_control_touch_session.html "The ControlTouchSession handles TouchEvents and emits several, more specific Events like the HoveredE..."). If the touch event is not consumed the [Courier](http://dev.doc.cgistudio.at/APILINK/namespace_courier.html) Touch Session will forward the touch messages to all widgets in the old touch handling style as message.

---

</div></div></div>#### Property Provider supports Value

<div class="contents" id="bkmrk-property-provider-%28p"><div class="contents"><div class="textblock">- Property Provider ([PropertyProviderBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_property_provider_behavior.html "Offers to set a property of a selectable type. These property can then be used for other Behaviors (e...")) supports Value variant type
- Send Value As Event has now PropertyReference that can be set to Other and point to Property Provider

---

</div></div></div>#### SelectionGroup memory leak patched

<div class="contents" id="bkmrk-patched-selectiongro"><div class="contents"><div class="textblock">- Patched SelectionGroup memory leak when creating new [ChangeSelectionEvent](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_change_selection_event.html "ChangeSelectionEvent is sent to a SelectionGroupBehavior with the Identifier of the currently selecte...")

---

</div></div></div>#### Arithmetic operation behavior created

<div class="contents" id="bkmrk-arithmetic-operation-0"><div class="contents"><div class="textblock">- Arithmetic operation behavior ([ArithmeticProcessValueBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_arithmetic_process_value_behavior.html "ArithmeticProcessValueBehavior allows to perform simple arithmetic operations on provided values...")) can be placed in ProcessValue chain to perform simple arithmetic operations on provided values.
- It allows to perform addition, subtraction, multiplication and division operations on the passed value.

---

</div></div></div>#### Send ChangeValueEvent on ProcessValueEvent behavior created

<div class="contents" id="bkmrk-%3Csend-changevalueeve"><div class="contents"><div class="textblock">- &lt;Send [ChangeValueEvent](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_change_value_event.html "Received by a ValueBehavior to change the value. Value can be absolute or relative (will be added)...") on ProcessValueEvent&gt; ([SendChangeValueOnProcessValueEventBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_send_change_value_on_process_value_event_behavior.html "Action Behavior which sends an ChangeValueEvent which is meant for changing the value of an Value Beh...")) can be used as a termination of ProcessValue chain to invoke value change on connected control
- This Behavior sends a [ChangeValueEvent](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_change_value_event.html "Received by a ValueBehavior to change the value. Value can be absolute or relative (will be added)...") which is meant for changing the value of an Value Behavior.
- The value can be absolute or relative (value will be added).

---

</div></div></div>#### ValueBehavior supports broadcast feature

<div class="contents" id="bkmrk-if-enabled%2C-valuebeh"><div class="contents"><div class="textblock">- If enabled, [ValueBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_value_behavior.html "Receives a ChangeValueEvent and passes its changed value to the receivers (Value Processing Behaviors...") can now be used to forward input value even if it is the same as current value stored in the behavior, which is useful in broadcasting context

---

</div></div></div>#### Provide Alignment adds Alignment property to the control

<div class="contents" id="bkmrk-provide-alignment-ca"><div class="contents"><div class="textblock">- Provide Alignment can be used to add a controllable Alignment property to the control
- [AlignmentBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_alignment_behavior.html "AlignmentBehavior Provides to set the horizontal and vertical alignment of a node. Especially for Control properties.") enables setting the horizontal and vertical alignment of a node.

---

</div></div></div>#### Tracks angle on touch with regard to control's base point

<div class="contents" id="bkmrk-track-angle-behavior"><div class="contents"><div class="textblock">- Track angle behavior allows to obtain the angle (from the position of user interaction) with regard to control's base point, using the mathematical function atan2.
- [TrackAngleProcessValueBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_track_angle_process_value_behavior.html "TrackAngleProcessValueBehavior listens to the touch of the selected node, returns the angle between p...") listens to the touch of the selected node, returns the angle between pressing, moving and releasing.

---

</div></div></div>#### DialBehavior supports Dial control

<div class="contents" id="bkmrk-dialbehavior-uses-th"><div class="contents"><div class="textblock">- [DialBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_dial_behavior.html "Dial behavior receives angle in ProcessValueEvent or value in ChangeValueEvent. It changes to appropr...") uses the angle obtained to calculate the rotation of the knob and change the position of the twisted knob to the value which is passed by ProcessValue function and [ValueChangedEvent](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_value_changed_event.html "ValueChangedEvent Event emitted from ValueBehavior when it changed its value.").
- [DialBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_dial_behavior.html "Dial behavior receives angle in ProcessValueEvent or value in ChangeValueEvent. It changes to appropr...") receives angle in ProcessValueEvent or value in [ChangeValueEvent](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_change_value_event.html "Received by a ValueBehavior to change the value. Value can be absolute or relative (will be added)..."). It changes to appropriate rotation for knob. Transmits the changed value through events ([ValueChangedEvent](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_value_changed_event.html "ValueChangedEvent Event emitted from ValueBehavior when it changed its value.") and ProcessValueEvent).

---

</div></div></div>#### CircularSlider behavior supports CircularSlider control

<div class="contents" id="bkmrk-circularsliderbehavi"><div class="contents"><div class="textblock">- [CircularSliderBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_circular_slider_behavior.html "CircularSliderBehavior that draws a blending mask and rotates thumb node.") draws a blending mask and rotates attached thumb.
- Creates respective effects on runtime, according to [Candera](http://dev.doc.cgistudio.at/APILINK/namespace_candera.html "[DataBinding_RefTypeSample]") build options.

---

</div></div></div>#### BreadcrumbBehavior supports breadcrumb control

<div class="contents" id="bkmrk-a-breadcrumb-is-used"><div class="contents"><div class="textblock">- A breadcrumb is used as a navigational aid in user interfaces.
- It allows users to keep track and maintain awareness of their location.
- Child nodes like Text, TextValue, TextButton or other nodes can react on [TextEvent](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_text_event.html "TextEvent provides the changed Text.") which is sent to child nodes.
- Also [BreadcrumbBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_breadcrumb_behavior.html "A breadcrumb used as a navigational aid in user interfaces. It allows users to keep track and maintai...") sends [ValueChangedEvent](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_value_changed_event.html "ValueChangedEvent Event emitted from ValueBehavior when it changed its value.") to the state machine with the last value that has been received.
- [BreadcrumbActionBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_breadcrumb_action_behavior.html "Action Behavior which sends breadcrumb action event allows you control the breadcrumb. The operations he can do are: add, go back one element and go back to the selected element.") allows you to control the breadcrumb.

---

</div></div></div>#### Provide Appearance adds Appearance property to the control

<div class="contents" id="bkmrk-provide-appearance-c"><div class="contents"><div class="textblock">- Provide Appearance can be used to add a controllable 3D Appearance property to the control
- Also extends Property Provider by Appearance.

---

</div></div></div>#### Control State Behavior properly handles Disabled State

Previously it was possible to still interact disabled Control via Inputs. In 3.7 this is not happening anymore (e.g. a disaled button cannot be pressed).

<div class="contents" id="bkmrk--2"><div class="contents"><div class="textblock">---

</div></div></div>#### Interpolate Value can be set to Instant Mode

Using the [ChangeInterpolationModeEvent](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_change_interpolation_mode_event.html "Class representing an event to set the animation mode for Interpolate Process Value Behavior...") in a Behavior allows to control which Mode the Interpolate Value will operate.

<div class="contents" id="bkmrk--3"><div class="contents"><div class="textblock">---

</div></div></div>#### Check Processed Value got extended by Almost Equal

Since comparing exact Float Values can lead to issues, the Check Processed Value Behavior now also supports checking if they are almost equal.

<div class="contents" id="bkmrk--4"><div class="contents"><div class="textblock">---

</div></div></div>#### TrackPositionProcessValue can be set to only react on dragging the Knob

Normally the TrackPositionProcessValue would also react to Inputs outside of the Knob Node. By enabling the Drag On Knob Only property, this can be prevented.

<div class="contents" id="bkmrk--5"><div class="contents"><div class="textblock">---

</div></div></div>#### Format String now supports all Variant Types

Format String did only support Integers and Float Values previously. This is now resolved.

<div class="contents" id="bkmrk--6"><div class="contents"><div class="textblock">---

</div></div></div>#### DrawerActionBehavior / "Change Drawer State"

The [DrawerActionBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_drawer_action_behavior.html "The DrawerActionBehavior sends a DrawerEvent to a DrawerBehavior. When the DrawerBehavior receives th...") has been created to support the new Drawer Control.

<div class="contents" id="bkmrk--7"><div class="contents"><div class="textblock">---

</div></div></div>#### ParticleEmitterBehavior / "Particle Emitter"

The ParticleEmitterBehavior has been created to support the new Point Sprite Emitter Control.

<div class="contents" id="bkmrk--8"><div class="contents"><div class="textblock">---

</div></div></div>#### Change Animation Mode by Event

The Animation Mode of [InterpolateProcessValueBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_interpolate_process_value_behavior.html "Expects a Float value as an event. InterpolateProcessValueBehavior holds an internal Float value...") can be changed by event now.

<div class="contents" id="bkmrk--9"><div class="contents"><div class="textblock">---

</div></div></div>#### Input Range for MapProcessValueBehavior

The [MapProcessValueBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_map_process_value_behavior.html "Expects a Float value as an event. Maps received value from one interval to another and returns it ba...") has been enhanced by an input range for use cases where parts of the input range of the ProcessValueEvent shall be processed by several [MapProcessValueBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_map_process_value_behavior.html "Expects a Float value as an event. Maps received value from one interval to another and returns it ba..."). The input range is optional. If not set, then the input range is taken from the ProcessValueEvent.

<div class="contents" id="bkmrk--10"><div class="contents"><div class="textblock">---

</div></div></div>#### RenderingEnabled Property now bindable

The property RenderingEnabled of behavior [RenderNodeBehavior](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_render_node_behavior.html "Sets rendering of a node enabled/disabled and provides the setting as a property for Controls...") / "Render Node" is now bindable.

<div class="contents" id="bkmrk-see-also%3A-rendernode"><div class="textblock"><dl class="see"><dt>**See also:**</dt><dd>[RenderNodeBehaviorBase::SetEnableRendering](http://dev.doc.cgistudio.at/APILINK/class_cgi_studio_control_1_1_render_node_behavior_base.html#a41ff9280f04d2ae83c532a6d168ab0db "[DataBinding_EnableRenderingPropertyGetterSetter]")</dd></dl></div></div>---