many people already gave replies to the questions, so I leave the example
of array encapsulation from my data structures workshop.
Very important, you don't get mouse control of the encapsulated array,
only of the top one. Maybe you should say exactly why you think you need
encapsulated arrays. If it's to draw a canvas/box, you can do that in the
same template as your main array.
Joao
On 05/25/2015 03:40 PM, jamal crawford wrote:
hey and thanks for the reply
...there is a bug since the very begining of puredata, if you don't delete data and modify your structure pd will crash
word!
also I think this is not a good idea to draw arrays within arrays, because bindings doesn't work anymore within arrays
so you mean I will need to defy new struct arguments for every array I will put in an array? if so, I won't mind that. so it is indeed possible to put an array within an array, its just me who is doing it in wrong creation order?
Yes, you can do that.
As far as order-- in Pd-l2ork I made a revision so that a struct will simply refuse to create if you give it an array field with a nonexistent template for the data. But it gives you an error saying so-- that way you can just go and create the template and it will work after that.
what about simply putting a canvas instead?
it just won't save the canvas and anything else beside the drawing (is there other ways to save the drawing besides [write( message?). i have a few of them and usually save them, so I can work on them later. and secondly its way much work to append 50+ arguments, when I can save them with a click.
Scalars and their data are saved with the patch.
donecanvasdialog message is designed to do this
exactly! :)
The coords message does the same without setting the "dirty" flag on the canvas (which will prompt for save before closing). Not sure if that matters in your case.
Also-- in a _single_ scalar, the shapes will be drawn using the order
that you created the drawing commands. So if you create a [filledpolygon] first, then create a [drawcurve] after that, the filled polygon will be drawn with the curve on top of it.If you draw two separate scalars that overlap, essentially you cannot control which one gets drawn on top. If you update one of the fields associated with a coordinate, that scalar will get drawn on top. But if I remember correctly certain operations in Pd (like updating an array) redraw _all_ the scalars, at which point you'll probably lose the
ordering you set up.This is in the process of getting fixed in Pd-l2ork. Since I'm using browser technology it'd also be possible to add a drawing command for 3d shapes using webgl. (But webgl is so much more complicated I'm not sure how it could be made usable in this context.)
-Jonathan
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list