Hi Jakob, Purr Data uses an HTML5 interface and the guis are drawn using SVGs. There is also Pd-l2ork 1.0 which uses a library called "tkpath" for a subset of SVG functionality on a special tkpath canvas widget. Sadly, the original author of that library passed away and AFAICT the library hasn't been ported forward for more recent versions of tcl/tk. As for tcl/tk-- it appears the next version of tk will do a one time conversion from an SVG file to a raster image. But that would not give you the ability to change any of the attributes on the fly-- e.g., rotating the knob based on input values. On the other hand, I guess you could load the same knob SVG image multiple times and just substitute a different rotation value for each image loaded. Once loaded, you could switch out the displayed image displayed with the correct rotation value for the given input. That's basically what I did for the little sprite game I wrote in Purr Data, and it worked pretty well both using tkpath and in HTML5[2].
[1] https://core.tcl-lang.org/tips/doc/trunk/tip/507.md%5B2] https://forum.puredata.info/topic/13081/purr-data-sprite-game On Friday, October 23, 2020, 12:07:45 PM EDT, Jakob Skouborg syntaxerror60@hotmail.com wrote:
Hey guys!Just some Friday thoughts about Pure Data and UI elements, like knobs, etc.:In VCV rack, it's pretty easy to make your own knobs for your modules. You can use the free open source program called Inkscape to make a knob, which is basically an SVG file.I was thinking that it would be really cool to be able to do something similar in Pure Data. To have an object/external that can load these knob SVG files into it, and then use the mouse to set a value(and knob position) between 0-1, either by dragging up/down or left/right and pressing the mouse on top of the object. It would really open up a whole new universe for Pure Data and making nice user interfaces. I have been playing with coding audio stuff for a few years in c++, mostly at hobby level, and I was wondering how hard it would be to make an object like that(if possible at all), that can load an SVG files created in Inkscape?Since VCV Rack is open source, I think I am going to see if I can find the code for the knob implementation this weekend, to see how it works in VCV.But first of all I am just curious about it and was looking for more experienced programmers though, especially you guys, who know a lot about PD, if it's a completely lost cause or if it is plausible idea.Personally I have not yet created any Pure Data externals, but I have been looking through some of dr. Hernandez pure data external creation tutorials on YT. I did make a bunch of VCV rack modules, so I know a bit about that.Any thoughts are welcome Besides that, have a great weekend! Best wishes, Jakob_______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev