X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=docs%2Fcontent%2Fprogramming-guide%2Flayer.md;fp=docs%2Fcontent%2Fshared-javascript-and-cpp-documentation%2Flayer.md;h=a9627d5d2aba55063d4cd5b2f517d2f3714129e7;hp=3cde1526246f22cb712d6fabf9d8800080a887e7;hb=63a4af2b863121be7ed57daee038d169d9ebe768;hpb=5f77331dd43fc3cf8b0fa7c5d4407575dc280982 diff --git a/docs/content/shared-javascript-and-cpp-documentation/layer.md b/docs/content/programming-guide/layer.md similarity index 76% rename from docs/content/shared-javascript-and-cpp-documentation/layer.md rename to docs/content/programming-guide/layer.md index 3cde152..a9627d5 100644 --- a/docs/content/shared-javascript-and-cpp-documentation/layer.md +++ b/docs/content/programming-guide/layer.md @@ -5,7 +5,6 @@ Layers provide a mechanism for overlaying groups of actors on top of each other. Layers can also clip their contents to exclude any content outside a user defined area. - ![ ](../assets/img/layer/layers.png) ![ ](layers.png) When a layer is added to the stage it is assigned a unique depth value. By default the stage has a root layer with a depth value of 0. @@ -18,20 +17,6 @@ **Note: Layers work independently of the actor hierarchy.** They can be positioned anywhere in the actor tree, but their draw order is always defined by their layer.getDepth() value. -~~~{.js} -// JavaScript Example of adding an actor to the root layer - -// using stage.add() will automatically add actor to the root layer -dali.stage.add( myActor ); - -// Or you can explicitly add actor to the root layer. -var rootLayer = dali.stage.getRootLayer(); -rootLayer.add( myActor ); // adds an actor to the root layer - -// rootLayer.getDepth() == 0 - -~~~ - ~~~{.cpp} // C++ example of adding an actor to the root layer @@ -51,40 +36,10 @@ rootLayer.add( myActor ); // adds an actor to the root layer Example To create two new layers on top of the root layer. -~~~{.js} -// JavaScript - -var layer1 = new dali.Layer(); -var layer2 = new dali.Layer(); - -// the initially depth order of each layer, depends on the order -// it is added to the stage. - -dali.stage.add( layer1 ); // will be drawn on top of root layer -dali.stage.add( layer2 ); // will be drawn on top of layer 1 - -dali.stage.add( myActor1); -layer1.add( myActor2); -layer2.add( myActor3); - -// dali.stage.getRootLayer().getDepth = 0 myActor1 drawn first ( on bottom ) -// layer1.getDepth() == 1 myActor2 drawn second ( in middle ) -// layer2.getDepth() == 2 myActor3 drawn last ( on top ) -~~~ - ### Layer clipping Clips the contents of the layer to a rectangle. -~~~{.js} -// JavaScript - -layer1.anchorPoint = dali.CENTER; -layer1.parentOrigin = dali.CENTER; -layer1.clippingEnable = true; -layer1.clippingBox = [20,20,100,100]; // X, Y, Width, Height -~~~ - ~~~{.cpp} // C++ @@ -121,11 +76,6 @@ Layers have two behaviour modes: ### Layer_2D -~~~{.js} -// JavaScript -layer.behaviour = "LAYER_2D"; -~~~ - ~~~{.cpp} // C++ layer.SetBehavior( Layer::LAYER_2D ); @@ -153,7 +103,6 @@ We have two layers below. Everything in the root layer is drawn first. If we did dali.stage.getRootLayer().raiseToTop(), then the root layer would be drawn last. -![ ](../assets/img/layer/layer2d.png) ![ ](layer2d.png) @@ -197,11 +146,6 @@ For example if we want the render draw order to be 8, 7, 6, with 6 being drawn l ### Layer_3D -~~~{.js} -// JavaScript -layer.behaviour = "LAYER_3D"; -~~~ - ~~~{.cpp} // C++ layer.SetBehavior( Layer::LAYER_3D ); @@ -213,14 +157,12 @@ 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. - ![ ](../assets/img/layer/layers3d.png) ![ ](layers3d.png) Transparent renderers are drawn in order of distance from the camera ( painter's algorithm ). - ![ ](../assets/img/layer/transSort.png) ![ ](transSort.png) @@ -238,32 +180,6 @@ The draw order of the actors inside the tree marked OVERLAY_2D, the draw order i Depth testing is not used. -Example: - -~~~{.js} -// JavaScript -var layer = new dali.Layer(); - -layer.behaviour = "LAYER_3D" - -dali.stage.add( layer ); - -layer.add( myActor1 ); -layer.add( myActor2 ); - -myActor3.drawMode = "OVERLAY_2D"; - -layer.add( myActor3 ); // actor 3 is drawn on top of actor 1 and 2 as it's in the OVERLAY. - -myActor3.add( myActor4 ); // actor 4 is drawn on top of actor 3, which is drawn on top of actor 1 and 2. - -myActor3.add( myActor5); // the depth index of actor 4 and 5 renderers will determine which is drawn first -~~~ - - - - - ### Layer Actor Specific Properties | Name | Type | Writable | Animatable| @@ -272,7 +188,6 @@ myActor3.add( myActor5); // the depth index of actor 4 and 5 renderers will det | clippingBox | ARRAY [0,0,400,600]) | 0 | X| | behaviour | STRING ( "LAYER_2D" or "LAYER_3D") | 0 | X| - @class Layer @extends Actor */