luametafun-groups.tex /size: 1429 b    last modification: 2021-10-28 13:50
1% language=us runpath=texruns:manuals/luametafun
2
3\environment luametafun-style
4
5\startcomponent luametafun-groups
6
7\startchapter[title={Groups}]
8
9This is just a quick example of an experimental features.
10
11\startbuffer
12\startMPcode
13    fill fullcircle scaled 2cm shifted ( 5mm,2cm) withcolor "darkblue" ;
14    fill fullcircle scaled 2cm shifted (15mm,2cm) withcolor "darkblue" ;
15
16    fill fullcircle scaled 2cm shifted ( 5mm,-2cm) withcolor "darkgreen" ;
17    fill fullcircle scaled 2cm shifted (15mm,-2cm) withcolor "darkgreen" ;
18
19    draw image (
20        fill fullcircle scaled 4cm                 withcolor "darkred" ;
21        fill fullcircle scaled 4cm shifted (2cm,0) withcolor "darkred" ;
22
23        setgroup currentpicture to boundingbox currentpicture
24            withtransparency (1,.5) ;
25    ) ;
26
27    draw image (
28        fill fullcircle scaled 3cm                 withcolor "darkyellow"
29            withtransparency (1,.5) ;
30        fill fullcircle scaled 3cm shifted (2cm,0) withcolor "darkyellow"
31            withtransparency (1,.5) ;
32    ) ;
33
34    addbackground withcolor "darkgray" ;
35\stopMPcode
36\stopbuffer
37
38\typebuffer[option=TEX]
39
40A group create an object that when transparency is applied is treated as
41a group.
42
43\startlinecorrection
44    \getbuffer
45\stoplinecorrection
46
47(Groups might become more powerful in the future, like reusable components but
48then some more juggling is needed.)
49
50\stopchapter
51
52\stopcomponent
53