Add more shared C++/JavaScript docs and add JavaScript wrapping guide
[platform/core/uifw/dali-toolkit.git] / plugins / dali-script-v8 / docs / content / render-task.js
1 /**
2  *
3
4 ## RenderTask API
5
6
7 RenderTasks describe how the Dali scene should be rendered.
8
9 The {{#crossLink "Stage/getRenderTaskList:method"}}{{/crossLink}} method provides access to an ordered list of render-tasks.
10
11 Each RenderTask must specify the source actors to be rendered, and a camera actor from
12 which the scene is viewed.
13
14
15 RenderTasks may optionally target a frame-buffer, otherwise the default GL surface is used;
16 typically this is a window provided by the native system.
17
18
19 By default Dali provides a single RenderTask, which renders the entire actor hierachy using
20 a default camera actor and GL surface. If stereoscopic rendering is enabled, Dali will create
21 two additional render tasks, on for each eye. Each render task will have its own camera parented
22 to the default camera actor.
23
24 The first RenderTask used for input handling will be the last one rendered, which also has input enabled,
25 and has a valid source & camera actor; see {{#crossLink "RenderTask/setInputEnabled:method"}}{{/crossLink}}.
26
27 If none of the actors are hit in the last RenderTask rendered, then input handling will continue
28 with the second last RenderTask rendered, and so on.
29
30 All RenderTasks which target a frame-buffer (i.e. off screen) will be rendered before all RenderTasks
31 which target the default GL surface. This allows the user to render intermediate targets which are used
32 later when targetting the screen.
33
34 A RenderTask targetting a frame-buffer can still be hit-tested, provided that the
35 screen->frame-buffer coordinate conversion is successful; see SetScreenToFrameBufferMappingActor().
36 ```
37 var tasklist = dali.stage.getRenderTaskList();
38   
39 var renderTask0 = tasklist.createTask();
40
41 renderTask0.setSourceActor( myActor );
42 renderTask0.setClearEnabled( true );
43 renderTask0.clearColor = [1.0,0.0,0.0,0.0];
44
45 renderTask0.clearColor = [1.0,0.0,0.0,0.0];
46
47 var camera = new dali.CameraActor();
48
49 renderTask0.setCameraActor( camera );
50 ```
51
52 ### Render Task Specific Properties
53
54
55 | Name                   |    Type    | Writable     | Animatable|
56 |------------------------|------------|--------------|-----------|
57 |viewportPosition       | VECTOR2    | ✔     | ✘ |
58 |viewportSize           | VECTOR2    | ✔     | ✘ |
59 |clearColor             | VECTOR4    | ✔     | ✘ |
60
61
62 @class RenderTask
63 */
64
65 /**
66  * View port position
67  *
68  * @property viewportPosition
69  * @type dali Vector2
70  */
71 viewportPosition
72
73 /**
74  * View port size
75  *
76  * @property parentOrigin
77  * @type dali Vector3
78  */
79 viewportSize
80
81  /**
82  * clear color
83  *
84  * @property clearColor
85  * @type dali Vector4
86  */
87  clearColor