2009-11-30 13:22:26 -05:00
|
|
|
[
|
|
|
|
{
|
|
|
|
"id" : "layout",
|
|
|
|
"type" : "ClutterBoxLayout",
|
|
|
|
"vertical" : true,
|
|
|
|
"spacing" : 12,
|
|
|
|
"pack-start" : false
|
|
|
|
},
|
|
|
|
{
|
actor: Parse actions, constraints and effects members
ClutterActor should allow attaching actions, constraints and effects
just like it allows behaviours, e.g.:
{
...
"constraints" : [
{
"type" : "ClutterAlignConstraint",
"source" : "stage",
"align-axis" : "x-axis",
"factor" : 0.5
},
{
"type" : "ClutterAlignConstraint",
"source" : "stage",
"align-axis" : "y-axis",
"factor" : 0.5
}
],
...
}
or:
{
...
"actions" : [
{
"type" : "ClutterDragAction",
"signals" : [
{ "name" : "drag-end", "handler" : "on_drag_end" }
]
}
],
...
}
In order to do so, we use the Scriptable interface implementation and
add three new custom properties accepting an array; then we parse each
member of the array as a new object.
2010-06-17 12:35:00 -04:00
|
|
|
"type" : "ClutterStage",
|
|
|
|
"id" : "main-stage",
|
2009-11-30 13:22:26 -05:00
|
|
|
"children" : [
|
|
|
|
{
|
actor: Parse actions, constraints and effects members
ClutterActor should allow attaching actions, constraints and effects
just like it allows behaviours, e.g.:
{
...
"constraints" : [
{
"type" : "ClutterAlignConstraint",
"source" : "stage",
"align-axis" : "x-axis",
"factor" : 0.5
},
{
"type" : "ClutterAlignConstraint",
"source" : "stage",
"align-axis" : "y-axis",
"factor" : 0.5
}
],
...
}
or:
{
...
"actions" : [
{
"type" : "ClutterDragAction",
"signals" : [
{ "name" : "drag-end", "handler" : "on_drag_end" }
]
}
],
...
}
In order to do so, we use the Scriptable interface implementation and
add three new custom properties accepting an array; then we parse each
member of the array as a new object.
2010-06-17 12:35:00 -04:00
|
|
|
"id" : "test",
|
|
|
|
"type" : "ClutterBox",
|
|
|
|
"layout-manager" : "layout",
|
|
|
|
"children" : [
|
|
|
|
{
|
|
|
|
"id" : "child-1",
|
|
|
|
"type" : "ClutterRectangle",
|
|
|
|
"width" : "3 em",
|
|
|
|
"height" : "3 em"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"constraints" : [
|
|
|
|
{
|
|
|
|
"type" : "ClutterAlignConstraint",
|
|
|
|
"name" : "x-align",
|
|
|
|
"factor" : 0.5,
|
|
|
|
"align-axis" : "x-axis",
|
|
|
|
"source" : "main-stage"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type" : "ClutterAlignConstraint",
|
|
|
|
"name" : "y-align",
|
|
|
|
"factor" : 0.5,
|
|
|
|
"align-axis" : "y-axis",
|
|
|
|
"source" : "main-stage"
|
|
|
|
}
|
|
|
|
]
|
2009-11-30 13:22:26 -05:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|