4 The Stage is a top-level object used for displaying a tree of Actors.
6 - Stage is a static object used by accessing the dali.stage object.
7 - Stage provides a top-level "root" actor.
8 - Stage provides Key Events to the application
9 - Stage has a background color you can set, see {{#crossLink "stage/setBackgroundColor:method"}}{{/crossLink}}
11 When an actor is not required, remove it from the stage to save memory and help performance.
13 dali.stage.setBackgroundColor( dali.COLOR_WHITE);
15 var stageSize = dali.stage.getSize();
17 var actor = new dali.Actor( );
19 dali.stage.add( actor );
21 // when the actor is no longer required
22 dali.stage.remove( actor );
25 ![ ](../assets/img/stage.png)
30 Key events are received through the keyEvent callback.
33 daliApp.myCallback = function (keyEvent)
35 switch (keyEvent.keyDescription) {
39 case "Down": log("down");
42 case "Left": log("left");
45 case "Right": log("right");
51 dali.stage.on("keyEvent", daliApp.myCallback);
54 The key event object has the following properties
57 state, // boolean = "down" or "up" key state
58 shiftPressed, // boolean, shift key is held
59 ctrlPressed, // boolean, ctrl key is held
60 altPressed, // boolean, alt key is held
61 keyModifiers, // key modifiers
63 keyDescription, // key description
64 timestamp // The time in milli-seconds when the event occured