Suppose I have this code:

\startMPpage

vardef MyShape(expr w, h) =
   save pth; path pth ;
   save pic; picture pic;
   pth = fullsquare xysized (w, h);
   pic := image (
       draw pth;
       % all kind of stuff here
   );
   setbounds pic to pth;
   pic
enddef ;

picture s ; s := MyShape(4cm, 2cm);

draw s;

drawdot center leftboundary  s withpen pencircle scaled 2 withcolor green;
drawdot center rightboundary s withpen pencircle scaled 2 withcolor blue;
drawdot point .25 along topboundary s withpen pencircle scaled 2 withcolor 
yellow;
drawdot .25[llcorner s, lrcorner s] withpen pencircle scaled 2 withcolor 
magenta;
drawdot origin  withpen pencircle scaled 2 withcolor red;

\stopMPpage

Can I reuse that varied across follow-up MPPages?

G

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to