I just started playing around with clutter a bit, and I got a question in regards to setting properties on a ClutterActor.
I want to set the pivot-point property, after searching though the reference, the function which seems the best fit is clutter_container_child_set_property (I couldn’t find anything with operated directly on the actor), so I’m trying
ClutterPoint point = {128,64};
clutter_container_child_set_property(CLUTTER_CONTAINER(stage), box, "pivot-point", point);
But I get an error, it expects the point to be of the type GValue , how do I change the clutter point to a gvalue?
clutter_container_set_propertyprobably isn’t the right way to go, but stuffing aClutterPointin aGValuewould look something like this:Once you have that you can use g_object_set_property to set the ClutterActor:pivot-point property:
Or you could just let GObject handle the GValue stuff for you and use g_object_set:
If you don’t already have the
ClutterPointsitting around for some other reason, the easiest method would be to just use clutter_actor_set_pivot_point:Of course, if you do already have the
ClutterPoint, you can also just usepoint.xandpoint.yinstead of128and64.