Dali 3D User Interface Engine
programming-languages

Programming Languages

DALi applications can be written in several different programming languages.

C++

...
bool OnPressed( Dali::Actor, const TouchEvent& event )
{
anim.AnimateTo( Property( actor, Actor::Property::POSITION ), Vector3( 200,-100,0), AlphaFunctions::Bounce );
anim.play();
return true; // consume the touch event
}
...
actor.TouchedSignal().Connect( &OnPressed );

*/

JavaScript

var actor = new dali.Actor();
actor.parentOrigin = dali.CENTER;
actor.anchorPoint = dali.CENTER;
dali.stage.add( actor );
...
function onPressed( actor, touchEvent )
{
var animOptions = { alpha: "bounce", delay: 0, duration: 15 };
var anim = new dali.Animation();
anim.animateTo( actor, "position", [ 200,-100,0], animOptions );
anim.play();
return true; // consume the touch event
}
...
actor.connect( "touched", onPressed );

JSON

{
"animations":
{
"move":
{
"duration": 1.5,
"properties":
[
{
"actor":"image",
"property":"position",
"value":[200,-100,0],
"alphaFunction": "BOUNCE"
}
]
}
},
"stage":
[
{
"name":"image",
"type":"Actor",
"anchorPoint": "CENTER",
"parentOrigin": "CENTER",
"signals" :
[
{ "name" : "touched", "action": "play", "animation": "move" }
]
}
]
}
Dali Docs Home
Read more about Dali