- // Action Names
- static const char* const ACTION_RAISE; ///< name "raise"
- static const char* const ACTION_LOWER; ///< name "lower"
- static const char* const ACTION_RAISE_TO_TOP; ///< name "raise-to-top"
- static const char* const ACTION_LOWER_TO_BOTTOM; ///< name "lower-to-bottom"
+ /**
+ * @brief Enumeration for the behavior of the layer.
+ *
+ * Check each value to see how it affects the layer.
+ * @SINCE_1_0.0
+ */
+ enum Behavior
+ {
+ /**
+ * @DEPRECATED_1_1.45, use LAYER_UI instead
+ * @brief UI control rendering mode.
+ * @SINCE_1_0.0
+ * @see LAYER_UI
+ */
+ LAYER_2D,
+
+ /**
+ * @brief UI control rendering mode (default mode).
+ *
+ * This mode is designed for UI controls. In this mode renderer order will be respective to tree hierarchy of Actors.
+ * This mode is expected to have better performance than LAYER_3D as renderers can be sorted more efficiently.
+ *
+ * For the following actor tree the rendering order will be A first, then B & C and finally D,E,F regardless of their
+ * Z positions.
+ * Rendering order between siblings, such as D, E & F or B & C, is determined based on the renderers depth index.
+ * In UI we don't normally expect overlap. If you have two overlapped actors, make them parent-child to guarantee order of all renderers.
+ *
+ * @code
+ *
+ * Layer1 (parent)
+ * |
+ * A
+ * / \
+ * B C
+ * / \ \
+ * D E F
+ *
+ * @endcode
+ *
+ * @SINCE_1_1.45
+ */
+ LAYER_UI = LAYER_2D,
+
+ /**
+ * @brief Layer will use depth test.
+ *
+ * When using this mode, depth test will be used. A depth clear will happen for each layer,
+ * which means actors in a layer "above" other layers will be rendered in front of actors in
+ * those layers regardless of their Z positions (see Layer::Raise() and Layer::Lower()).
+ * Opaque renderers are drawn first and write to the depth buffer.
+ * Then transparent renderers are drawn with depth test enabled but depth write switched off.
+ * Transparent renderers are drawn based on their distance from the camera.
+ * A renderers DEPTH_INDEX property is used to offset the distance to the camera when ordering transparent renderers.
+ * This is useful if you want to define the draw order of two or more transparent renderers that are
+ * equal distance from the camera.
+ * Unlike LAYER_UI, parent-child relationship does not affect rendering order at all.
+ *
+ * @SINCE_1_0.0
+ */
+ LAYER_3D
+
+ };