[PD] [draw] object

Jonathan Wilkes jancsika at yahoo.com
Sun Dec 15 08:14:27 CET 2013


Hi list,
    I got a new object class going:
[draw] - associate an svg drawing instruction with a [struct]

So far I've got rect, circle, polygon, polyline, and path supported with methods for all their basic drawing attributes (fill, fill-opacity, etc.)

Here's  a demo with a well-known logo for Pd:
http://www.jonathanwilkes.net/pd.webm


The cool thing is that like the old parent widgets, you can associate any of the shape coordinates or attribute values with one of the struct's member fields like "yin" or "yang" as in the demo.
Only thing that is a bit tricky: svg has some symbolic attributes, and with data structures there's no standard way to tell the difference between a symbol constant like "green" and a variable name like "x2color".  Currently I'm just using floats to stand in for the symbol constants but that's rather ugly (especially for someone familiar with svg who has to look up that 2 = "bevel" in some table somewhere).

-Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20131214/ebbf338a/attachment.htm>


More information about the Pd-list mailing list