4 # Hello World - JSON layout{#script-hello}
6 The following JSON code is the minimum required to put the sentence "Hello World" on the screen.
14 "text": "Hello World",
15 "parentOrigin": "CENTER"
20 The following code loads the JSON file
24 Builder builder = Builder::New();
26 std::string json_data(ReadFile("layout.json"));
28 builder.LoadFromString(json_data);
30 builder.AddActors( Stage::GetCurrent().GetRootLayer() );
37 var builder = new dali.Builder();
39 builder.loadFromFile("layout.json");
41 builder.addActors( dali.stage.getRootLayer )
44 ## Hello World - Javascript
46 The DALi script application is needed to run the Javascript which provides a Javascript runtime and an interface to Dali.
49 scripting.example hello-world.js
52 The TextLabel control to display Hello World can be constructed using Javascript dot notation accessing DALi Actor Properties.
57 var textLabel = new dali.TextLabel();
59 textLabel.text = "Hello World";
60 textLabel.fontFamily = "FreeSans";
61 textLabel.fontStyle = "Regular";
62 textLabel.parentOrigin = dali.CENTER;
64 dali.stage.add( textLabel );
67 @class _Guide_Script_Hello_World