Hi,

What would be the recommended way of keeping an actor centered inside a
group?


I've unsuccessfully tried to keep a specific actor centered inside a custom
ClutterGroup, which contains a few other actors. To goal is for whatever
other actors are added to the group, I would like to keep this 1 actor
centered to the group.


I tried by overriding the allocate() function so that whenever the group
size changes, I would set my actor position manually. Although the end
result looked good, it threw a ton of warnings: "Clutter-WARNING **: The
actor 'CustomButton' is currently inside an allocation cycle; calling
clutter_actor_queue_relayout() is not recommended".


Then I figured I'd simply use constraints. Using a ClutterAlignConstraint on
the actor I want to keep centered should allow me to keep this actor
centered whenever the ClutterGroup changes size (or so I thought). So far,
if I set the constraint using the ClutterGroup, I get random behaviours. If
I use the biggest actor contained in the group, then it looks ok, but still
get a ton of allocation cycle warnings.

Any idea what I'm doing wrong? I'm setting up the constraints inside a
"property_set" call when the actor is added to the group, so that might be
the issue, but I'm unsure as to how I should bypass this.

Thanks for any help!

--
Dominique Bureau
_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list

Reply via email to