Re: Issue getting exact image coordinates during image animation.



On Thu, 2010-08-05 at 15:58 +0200, Marc Ford wrote:
> I am having a problem with GooCanvasImage
> 
> I am trying to get the x and y coordinates of the image while it is
> undergoing animation.
> 
> I set up the image and animate it to move from the top of the screen
> to the bottom.
> 
> When I call $canvas_image->get('y') in my perl code. It always returns
> the original starting y coordinate of image, not its current location
> during its animation.
> 
> Am I doing something wrong? Do I have to call an update function or
> something similar beforehand?  Would a code example help?

The animation changes the item's transformation matrix, rather than its
x and y coordinates.

So you could use goo_canvas_item_get_transform() or 
goo_canvas_item_get_simple_transform() to get the transformation matrix,
or possibly just use goo_canvas_item_get_bounds() to get the bounds of
the item in the canvas coordinate space.


We could do with a link to a decent tutorial for transformation
matrices.

Damon




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]