The template section supports the creation of actor instances. The
template name can be used in code to create an actor tree.
+~~~{.js}
+// JavaScript
+
+var builder = new dali.Builder();
+builder.loadFromFile( "my-app.json");
+var userActorTree = builder.create( { template:"basic-text"} );
~~~
+
+~~~{.cpp}
+// C++
+
+Builder builder = Builder::New();
+std::string jsonData = loadFile("my-app.json");
+builder.LoadFromString( jsonData );
+
actorTree = builder.Create("basic-text");
~~~
Templates consist of a name, multiple property-value configurations and
an optional actor sub hierarchy.
-~~~
+~~~{.json}
{ //
"templates": // Template library section
{ //
The styles section supports a named set of properties that can be
applied to an actor or actor tree.
-~~~
+~~~{.cpp}
+// C++
+
Builder.ApplyStyle("light-theme", myActor);
~~~
-The styles can also be applied as an animation.
+~~~{.js}
+// JavaScript
+builder.applyStyle("light-theme", myActor);
~~~
+
+
+The styles can also be applied as an animation.
+
+~~~{.cpp}
Builder.AnimateTo("light-theme", myActor, TimePeriod(0, 10));
~~~
+
+
~~~
{ //
"styles": // Style set section
Paths are defined in a top level path section and referenced by the
animation property.
-~~~~
+~~~
{ //
"paths": // Path library
{ //
// animation.
}, //
} //
-~~~~
+~~~
## Shaders {#shaders}
Similarly one named shader instance can be set to several actors and can
be animated by one animation.
-~~~~
+~~~
{ //
"shader-effects": // Shader Effect section
{ //
...
}]
}
-~~~~
+~~~
At least one of the vertex or fragment fields is mandatory. All
other fields are optional will use internal defaults.
uniform to animate correctly. The convention in DALi is to prepend
uniforms with 'u'.
-~~~~
+~~~
{ \\
"animations": \\ Animation library
{ \\
}
]
},
-~~~~
+~~~
## Stage {#stage}
The stage is a tree of actors that can be added to Dali's stage object.
~~~
+// C++
builder = Dali.Builder();
json_text = load("layout.json");
builder.Load(json\_text);
builder.AddActors( stage.GetRootLayer()); // Add actors to the stage root layer
~~~
+~~~{.js}
+// JavaScript
+
+builder.addActors( dali.stage.getRootLayer() );
+~~~
+
~~~
{ \\
"stage": \\ Stage Section Number
Please refer to the above document for further information about specific
controls.
-@class ScriptJsonSpecification
+@class _Guide_JSON_Specification
*/