[dali_1.0.39] Merge branch 'tizen'
[platform/core/uifw/dali-toolkit.git] / docs / content / programming-guide / script-hello.h
1 /*! \page script-hello Scripting Hello World
2  *
3  * <h2 class="pg">Hello World - JSON layout</h2>
4  *
5  * The following JSON code is the minimum required to put the sentence "Hello World" on the screen.
6  *
7  * @code
8  * {
9  *  // a tree of actors
10  *  "stage": [{
11  *    "name": "text-label",
12  *    "type": "TextLabel",
13  *    "text": "Hello World",
14  *    "parent-origin": "CENTER"
15  *  }]
16  * }
17  * @endcode
18  *
19  * The following c++ code loads the JSON file
20  *
21  * @code
22  * Builder builder = Builder::New();
23  *
24  * std::string json_data(ReadFile("layout.json"));
25  *
26  * builder.LoadFromString(json_data);
27  *
28  * Actor actor = builder.GetActor("text-label");
29  *
30  * Stage::GetCurrent().Add(actor);
31  * @endcode
32  *
33  * <h2 class="pg">Hello World - Javascript</h2>
34  *
35  * Hello world can also be executed via Javascript.
36  *
37  * The Dali script application is needed to run the Javascript which provides a Javascript runtime and an interface to Dali.
38  *
39  * @code
40  * daliscript hello-world.js
41  * @endcode
42  *
43  * The TextLabel control to display Hello World can be constructed using Javascript dot notation accessing Dali Actor Properties.
44  *
45  * @code
46  * var textLabel = Dali.TextLabel();
47  *
48  * textLabel.text          = "Hello World";
49  * textLabel.font-family   = "FreeSans";
50  * textLabel.font-style    = "Regular";
51  * textLabel.parent-origin = "CENTER";
52  *
53  * Dali.Run();
54  * @endcode
55  *
56  */
57
58