I posted this on the cusp of the list changeover. I have edited it a little for this repost. Apologies for any snafus.

---
Using: pyclutter for clutter 1.0
---

I am arithmetically challenged, but I shall soldier-on. I want to work with Actors and Groups with the default 'anchor' being in the center.

For example, I have a 64x64 Actor (C) and a 128x128 Group (P) and another 512x512 group (P2), so:
stage
\_P2
   \_P
     \_C

stage.add(P2) <- Should put P2 in the middle of the stage
P2.add(P) <- Should put P in the middle of P2
P.add(C) <- Should put C in the middle of P
If I then use clutter_actor_move_by(), I should be able to move stuff away from 0,0 as needed.

Basically, I want (0,0) within an Actor/Group to be in the 'middle' of its area. I also want the axis to be: negative left/down, positive right/up.

Using set_anchor_point() seems to solve half the problem, I still have to be cautious about set_position() and I find I am doing all kinds of width/2, height/2 and having to remember to offset things in such ways.

I was rather hoping there was some kind of "matrixy" solution, like Cairo can do with its context. I can draw stuff from 0,0 in +/- directions and then invoke matrix voodoo and shift all of it around.

What I am aiming at (in the short term) is a simple SVG editor.
Imagine drawing nodes and so forth: many node actors within a group (or several deep.) I am using cairo to draw, so each Actor is a CairoTexture, but my problems are with area — how I 'grow' an Actor (and maintain proper positioning of all parts) when the drawing (and mouse clicks) begin to exceed the initial size of the Actor.

One idea is to have an 'edit mode' for this which makes the Actor as large as the visible screen area (window size). When the user moves the 'page' (say to the right), the area must change again — all to keep it 'screen sized' so that it can catch mouse clicks etc. When 'edit mode' ends, new bounds are known, so the Actor can be reset to that.

Rather complex, so I am trying to break it down, starting with the notion of working outwards from a central 0,0 point.

Any suggestions, etc?

Thanks,
\d
_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list

Reply via email to