On 25/06/2010 00:58, Emmanuele Bassi wrote:
the actor's coordinate space is always relative to the parent's
reference point; this is usually the top-left corner but it can be
moved using the anchor point API.
Okay, I have an example attached so that you can school me :) I am quite
confused by this subject.
Cairo drawing has nothing to do with Clutter: you have to change the
Cairo transformations with the Cairo API.
I do see this, but .. let's leave cairo for later.
no, I think the "muddle" is not mathematical - it's just a
terminology issue.
Yes it is, and that terminology comes from the world of maths. I find
the docs (esp. the Actor Description part) to be way out of my sphere of
ken. It makes sense to those who code the API, but I never had the basic
education on these subjects. I do try.
All I can say is, "more pictures!" Artists use clutter too. :D
(I will be happy to draw some for the docs when I get a clue.)
Thanks ebassi,
\d
import clutter
class VisibleGroup( clutter.Group ):
"""Trying to 'see' a group so I can get a clue."""
def __init__( self, init_area, colstr ):
clutter.Group.__init__(self)
w, h = init_area # just start somewhere.
## A rect makes this group 'visible'
## The group should automatically be the same size...
rect = clutter.Rectangle(clutter.color_from_string(colstr))
rect.set_size(w, h)
rect.set_position(0,0)
self.add(rect)
if __name__ == '__main__':
stage = clutter.Stage()
stage.set_color(clutter.color_from_string('Black'))
stage.set_size(1024, 1024)
"""
ebassi says: the actor's coordinate space is always relative to the parent's
reference point; this is usually the top-left corner but it can be moved
using the anchor point API
"""
stage.set_anchor_point(512,512) # <- Make other actors relative to middle ?
## My poor understanding is that this shifts "0,0" onto 512,512
## but it seems I am not seeing this properly.
## Big group
PTOP = VisibleGroup( (512,512), 'yellow')
## Now, I expect to see a yellow box in the middle of the stage:
stage.add( PTOP )
## I don't see that. It goes to the top left.
## (I am not sure if my group and the triangle are properly aligned.)
## This implies (to me) that 0,0 in PTOP (top left) is STILL 0,0 in
## stage. What am I missing?
stage.connect('key-press-event', clutter.main_quit)
stage.connect('destroy', clutter.main_quit)
stage.show()
clutter.main()
_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list