3 # Hello World - JSON layout{#script-hello}
5 The following JSON code is the minimum required to put the sentence "Hello World" on the screen.
13 "text": "Hello World",
14 "parent-origin": "CENTER"
19 The following code loads the JSON file
23 Builder builder = Builder::New();
25 std::string json_data(ReadFile("layout.json"));
27 builder.LoadFromString(json_data);
29 builder.AddActors( Stage::GetCurrent().GetRootLayer() );
36 var builder = new dali.Builder();
38 builder.loadFromFile("layout.json");
40 builder.addActors( dali.stage.getRootLayer )
43 ## Hello World - Javascript
45 The Dali script application is needed to run the Javascript which provides a Javascript runtime and an interface to Dali.
48 scripting.example hello-world.js
51 The TextLabel control to display Hello World can be constructed using Javascript dot notation accessing Dali Actor Properties.
56 var textLabel = new dali.TextLabel();
58 textLabel.text = "Hello World";
59 textLabel.fontFamily = "FreeSans";
60 textLabel.fontStyle = "Regular";
61 textLabel.parentOrigin = dali.CENTER;
63 dali.stage.add( textLabel );
66 @class _Guide_Script_Hello_World