Dear Aditya,

Thank you for your code and an explanation.

Let's assume that the last MPpage was a \startuseMPgraphic{boxes} .... \stopuseMPgraphic. Suppose I wanted to use these pictures in a presentation. On the first slide, I can use

   \useMPgraphic[stacking=0]{boxes}

to show the three boxes, and on the next slide, I can use

   \useMPgraphic[stacking={-1,0}]{boxes}


I tried to reproduce your example using \startuseMPgraphic{boxes} … \stopuseMPgraphic, and useMPgraphic[stacking=0]{boxes} .
A modified one of your code is below.
There is no error message but no output at all.
Would you please tell me what is wrong in here?

Best regards,
Dalyoung


\startMPdefinitions
input boxes;

primarydef a +- b =
a -- (xpart a, ypart b) -- b
enddef ;
primarydef a -+ b =
a -- (xpart b, ypart a) -- b
enddef ;
\stopMPdefinitions
\defineframed
[boxframed]
[
width=6em,
height=2\lineheight,
align={middle,lohi},
background=color,
backgroundcolor=blue,
foregroundcolor=white,
forefroundstyle=bold,
]

\startuseMPgraphic[offset=2mm]{boxes}
boxit.A("\boxframed{Box A}");
boxit.B("\boxframed{Box B}");
boxit.C("\boxframed{Box C}");

defaultdx := 0pt;
defaultdy := 0pt;

A.c = origin;

B.w - A.e = (1cm, 0);

0.5[ A.s, B.s ] - C.n = (0, 1cm);

stacking := 0;
drawunboxed(A,B,C);
stacking := 1;
drawarrow A.s +- C.w ;
drawarrow B.s +- C.e ;

newpath highlight;

highlight := (A.sw -- B.se -- B.ne -- A.nw) enlarged EmWidth;
fill highlight withcolor "darkgray" withstacking -1;

\stopuseMPgraphic

\starttext
\useMPgraphic[stacking={0}]{boxes}
\useMPgraphic[stacking={0,1}]{boxes}
\useMPgraphic[stacking=-1]{boxes}
\stoptext