0f535537c2
* clutter/clutter-actor.c: (clutter_actor_set_property), (clutter_actor_get_property), (clutter_actor_class_init): Add the rotation-* properties, controlling the rotation angle and center on each axis. (#614) (parse_rotation_array), (parse_rotation), (clutter_actor_parse_custom_node), (clutter_actor_set_custom_property), (clutter_scriptable_iface_init): Add a new "rotation" custom property for expressing the rotation along each axis in a compact way: "rotation" : [ { "x-axis" : [ <angle>, [ <y>, <z> ] ] }, { "y-axis" : [ <angle>, [ <x>, <z> ] ] }, { "z-axis" : [ <angle>, [ <x>, <y> ] ] } ] (clutter_geometry_get_type),(clutter_vertex_get_type), (clutter_actor_box_get_type): Use the I_() macro instead of directly calling g_intern_static_string(). * clutter/clutter-entry.c (clutter_entry_request_coords): * clutter/clutter-label.c (clutter_label_ensure_layout), (clutter_label_request_coords): Use CLUTTER_UNITS_FROM_DEVICE() instead of CLUTTER_UNITS_FROM_INT(), as "device" means "pixels". * clutter/clutter-private.h: Add the I_() macro for intern static strings. * tests/test-script.json: Test the newly added "rotation" custom property.
81 lines
2.0 KiB
JSON
81 lines
2.0 KiB
JSON
{
|
|
"My Scene" : {
|
|
"id" : "main-stage",
|
|
"type" : "ClutterStage",
|
|
"color" : "white",
|
|
"signals" : [
|
|
{ "name" : "key-press-event", "handler" : "clutter_main_quit" }
|
|
],
|
|
"children" : [
|
|
{
|
|
"id" : "red-button",
|
|
"type" : "ClutterRectangle",
|
|
"color" : "#ff0000ff",
|
|
"x" : 50, "y" : 50, "width" : 100, "height" : 100,
|
|
"visible" : true,
|
|
"reactive" : true,
|
|
"rotation" : [
|
|
{ "z-axis" : [ 45.0, [ 75, 75 ] ] }
|
|
],
|
|
"behaviours" : [ "fade-behaviour", "path-behaviour" ],
|
|
},
|
|
{
|
|
"id" : "green-button",
|
|
"type" : "ClutterRectangle",
|
|
"color" : "#00ff00ff",
|
|
"border-width" : 5,
|
|
"border-color" : "#00cc00ff",
|
|
"x" : 200,
|
|
"y" : 50,
|
|
"width" : 100,
|
|
"height" : 100,
|
|
"visible" : true,
|
|
"reactive" : true
|
|
"signals" : [
|
|
{ "name" : "button-press-event", "handler" : "clutter_main_quit" }
|
|
]
|
|
},
|
|
{
|
|
"id" : "red-hand",
|
|
"type" : "ClutterTexture",
|
|
"pixbuf" : "redhand.png",
|
|
"x" : "50%",
|
|
"y" : "50%",
|
|
"width" : "20mm",
|
|
"height" : "100px",
|
|
"opacity" : 100,
|
|
"visible" : true,
|
|
"behaviours" : [ "rotate-behaviour", "fade-behaviour" ]
|
|
},
|
|
{
|
|
"id" : "red-hand-clone",
|
|
"type" : "ClutterCloneTexture",
|
|
"parent-texture" : "red-hand",
|
|
"x" : 250,
|
|
"y" : 150,
|
|
"opacity" : 100,
|
|
"visible" : true
|
|
},
|
|
{
|
|
"id" : "label",
|
|
"type" : "ClutterLabel",
|
|
"x" : 50,
|
|
"y" : 200,
|
|
"width" : 400,
|
|
"text" : "Clutter\tScript",
|
|
"font-name" : "Sans 24px",
|
|
"color" : "black",
|
|
"alignment" : "center",
|
|
"wrap" : false,
|
|
"ellipsize" : "none",
|
|
"visible" : true
|
|
"rotation" : [
|
|
{ "y-axis" : [ 60.0, [ 275, 100 ] ] },
|
|
{ "z-axis" : [ 45.0, [ 75, 75 ] ] }
|
|
],
|
|
}
|
|
"blue-button",
|
|
]
|
|
}
|
|
}
|