Re: [clutter] Confusing child actors behavior

2010-03-24 Thread Neil Roberts
Hi

(sorry if I've sent this twice, I'm having a bit of trouble with my mail
client)

On Tue, 23 Mar 2010 14:00:50 -0500, Uday Verma uday.ka...@gmail.com wrote:
 I am trying to animate a sub-actor inside a ClutterActor but I can't
 seem to be able to do so.
 
 I have an actor A which contains several Bs, A is not a container but
 a regular actor.  I have a add method which adds B to A, and in the
 process does B.set_parent (A).
 
 1.  When I do so, right after the parenting operation I set the
 position and dimensions of B.  The position and dimension requests are
 not being regarded and according to --clutter-flags=paint, the
 allocation of actor B is {0,0,0,0}.  I wonder why that is when I am
 explicitly setting the size and position.  The only way I could get
 the actor B to appear was by explicitly setting the allocation of
 actor B to the desired location.

Setting the size of an actor just replaces the preferred and minimum
sizes that would be returned by get_preferred_with/height. The actor
still needs to be allocated to get an actual size. Any actor that has
children must implement the allocate method to call allocate on its
children. Your allocate method should be something like this (note I
don't know Vala so I'm just guessing):

public override void allocate (Clutter.Actor actor,
   Clutter.ActorBox box,
   Clutter.AllocationFlags flags)
{
  /* Chain up so we still get an allocation (I don't know Vala's syntax
 for this so I'll use C++) */
  actor.ClutterActor::allocate (actor, box, flags);

  /* Allocate all of the children at their natural size and position */
  foreach (var a in children.values)
a.allocate_preferred_size ();
}

You also need to implement paint, pick, map and unmap in a similar
way. You can get away without pick if the children don't need to handle
events and it will work without map and unmap if you always add actors
after the container is mapped (but it's cleaner just to implement them).

- Neil
-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com



[clutter] Clutter stage transparency

2010-03-24 Thread Sean V. Kelley
With Clutter 1.2.x and if you're running with a compositor engine on
X11, then I should be able to set the opacity using
clutter_actor_set_opacity() on the stage, just like you can on every
other actor.

However, are there limitations such as the video card or the particular
compositor being used?

Sean


-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com



Re: [clutter] Clutter stage transparency

2010-03-24 Thread Bastian Winkler
You also have to set the :use-alpha property

http://www.clutter-project.org/docs/clutter/stable/ClutterStage.html#ClutterStage--use-alpha

so long

:wq buz

On Wed, Mar 24, 2010 at 02:25:30PM -0700, Sean V. Kelley wrote:
 With Clutter 1.2.x and if you're running with a compositor engine on
 X11, then I should be able to set the opacity using
 clutter_actor_set_opacity() on the stage, just like you can on every
 other actor.
 
 However, are there limitations such as the video card or the particular
 compositor being used?
 
 Sean
 
 
 -- 
 To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
 

-- 
Multitasking = screwing up several things at once.

GnuPG Fingerprint: 2FFF FC48 C7DF 1EA0 00A0  FD53 8C35 FD2E 6908 7B82


signature.asc
Description: Digital signature


Re: [clutter] Clutter stage transparency

2010-03-24 Thread Emmanuele Bassi
On Wed, 2010-03-24 at 22:59 +0100, Bastian Winkler wrote:
 You also have to set the :use-alpha property
 
 http://www.clutter-project.org/docs/clutter/stable/ClutterStage.html#ClutterStage--use-alpha

and call:

  clutter_x11_set_use_argb_visuals (TRUE);

before calling clutter_init(), since:

  • it is an opt-in feature
  • it is a platform-specific feature

ciao,
 Emmanuele.

-- 
Emmanuele Bassi, Open Source Software Engineer
Intel Open Source Technology Center

-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com