On Thu, 2008-12-25 at 17:52 +0100, Thomas Steinacher wrote:
> Thanks for all your helpful sample code. I will try to implement it
> without inheriting from ClutterGroup. However, I am still not sure
> about the animations:
> 
> - Can I use things like clutter_effect_move/ClutterBehaviourPath to
> animate the movements when changing a sizer? Or would I use a
> ClutterTimeline and call queue_relayout and interpolate the position
> in the get_allocation() of my layout manager?

the latter. BehaviourPath will call set_position() for you. animating a
layout must use the layou facilities, because as soon as you specify the
position manually you automatically enable the fixed positioning code.

you can in theory animate to the end position and then disable the fixed
positioning by setting the :fixed-position-set property on the actor to
FALSE - but your layout manager must take that into account after the
animation is complete:

  - choose the actor to be repositioned
  - call set_position() until animation complete
  - set('fixed-position-set', False)
  - queue_relayout()

> - Is it possible to still use set_position() on the children?

yes, it's possible, but then you are on your own when re-layouting their
container; you will have to query the actor position, check whether it's
a fixed position, and draw the actor accordingly.

>  Let's
> say I have a "random sizer" which would place new children randomly,
> but it would allow the user to drag elements around using the mouse
> (and possibly use a physics/collision detection library to move other
> actors of the container out of the way using animation).

if clutter-box2d is that library - in that case, the Box2D container is
a fixed layout manager and you cannot change that.

you cannot mix fixed layout and fluid layout at the same time: either a
container is a fixed layout manager and every child is positioned
manually, or it is a fluid layout manager and it allocates its children
automatically. you can switch between states, though, so you can do
manual transitions and animations as a fixed layout and then return to a
non-fixed layout when you're done by unsetting :fixed-position-set and
queueing a relayout.

ciao,
 Emmanuele.

-- 
Emmanuele Bassi, Intel Open Source Technology Center

-- 
To unsubscribe send a mail to [email protected]

Reply via email to