While I'm testing the draw object, I miss a pointer inlet to manipulate scalars individually
To manipulate a scalar's visual appearance, change the data associated with it.
Example: set a data field and associate it with a drawing instruction:
[struct foo float x float y float myField][loadbang]|[opacity myField(|[draw rect 40 40][foo][foo][foo]
Now right-click and choose properties on each "foo" scalar, then update the value of "myField" to whatever you want for the opacity to be (between 0 and 1).
When the data field is changed, Pd will update the associated visual attribute accordingly.
My main purpose is about having clickable images for designing interfaces, and this works so far so good. This drag option with some constraint would be excellent for designing a slider...
I wanted to ask somewhere if it's possible to draw ttf fonts with the svg tools? One of my goals is about having a font chooser for Gem and eventually a color chooser, with tk there already is something cool.
This drag option with some constraint would be excellent for designing a slider...
Notice that the "drag" event doesn't actually drag the object. It just sends the notification to the relevant [draw] object.
That way you can define arbitrary constraints/responses using a normal Pd object chain.
As far as ttf fonts-- you can draw them with svg. But svg text doesn't flow like HTML does. If you use arbitrary fonts in svg you have to remember that the font engine on the user's platform can render the font taller/wider than what you're seeing on your own machine.
That's the reason I don't yet have a [draw text] object. It makes it too easy for a user to perfectly position text in an interface and generate overlaps on another user's platform.
For that reason I'd suggest using HTML to make a font chooser.
While I'm swimming into source files to understand deeper the GUI mechanisms, I'm wondering if it's possible to use node plugins for drawing my interfaces and doing some complicated stuff like convert ttf to svg and vice versa...
Also I haven't found out how to refresh image without destroying/creating [draw image], this is quite useful in projects like the one I've submitted to pdlist that is about drawing a preview of gem window.
It would be great if the image data could be stored/retrieved in/from datastructure, but I don't know yet how to do this.