[libavg-devel] Constructor arguments and python attributes aligned

Ulrich von Zadow uzadow at libavg.de
Wed Jul 29 23:12:42 CEST 2009


Hi,

I've been working on bug #65 (https://www.libavg.de/mantis/view.php?id=65 
) and added point and vector-typed constructor arguments. That means  
that things like pos, size and texcoord can now be passed to  
createNode or specified in an avg file, which I think is pretty cool.

To keep a clean interface, I also made sure that node constructor  
arguments are the same as the python attributes. That meant some api  
changes:

- All AreaNodes now have pos and size attributes.
- The former Words::size attribute had to be renamed to fontsize.
- pivotx and pivoty have been replaced by pivot.
- For all vector node types, x and y attributes have been replaced by  
pos attributes.
- Also for vector nodes, I've added texcoord constructor params.

Warning: The attributes that I've removed are dangerous. Since this is  
python, you can still set (for example) line.x1. It just won't do what  
you expected anymore. Still, I think the cleaner interface is worth  
it. (And if anyone has an idea on how to prevent usage of the removed  
attributes, I'd be happy to hear it.)

Cheers,

   Uli

--
Any technology distinguishable from magic is insufficiently advanced.

Ulrich von Zadow | +49-172-7872715
Jabber: coder at c-base.org
Skype: uzadow






More information about the libavg-devel mailing list