1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
% \iffalse
% --------------------------------------------------------------------
% <*utils>
% \fi
%
% \subsubsection{VASSAL icons}
%
%
% Some icons that may be useful in VASSAL. We put them here so they
% may be used in manuals and the like too.
%
%
% First, the line style
% \begin{macrocode}
\tikzset{
trash can line/.style={scale line widths,scale rounded corners,
line width=.5mm,->},
}
% \end{macrocode}
%
% Then, the body and lid of a trash can.
%
% \begin{macrocode}
\tikzset{
trash can body/.pic={%
\path[fill=black,scale line widths,scale rounded corners,
rounded corners=.05cm]
(-.3,.2) --++(.6,0) --++(-.1,-.7) --++(-.4,0) --cycle;
\path[fill=white]
(-.025,-.4) arc(180:360:.025) --++( 0,.5) arc(0:180:.025) --cycle;
\path[fill=white]
(-.125,-.4) arc(180:360:.025) --++(-.07,.5) arc(0:180:.025) --cycle;
\path[fill=white]
( .075,-.4) arc(180:360:.025) --++( .07,.5) arc(0:180:.025) --cycle;
},
trash can lid/.pic={%
\path[fill=black,scale line widths,scale rounded corners,
rounded corners=.05cm]
(-.35,.23)--++(.7,0)--++(-.07,.07)--++(-.56,0)--cycle;
\path[fill=black]
(-.15,.3) --++(.05,0) --++(0,.05) --++(.2,0) --++(0,-.05)
--++(.05,0) --++(0,.05) arc(0:90:.05) --++(-.2,0) arc(90:180:.05)
--cycle;
},
}
% \end{macrocode}
%
% Then, a closed and open trash can
%
% \begin{macrocode}
\tikzset{
trash can/.pic={
\pic{trash can body};
\pic{trash can lid};
},
trash can open/.pic={
\pic{trash can body};
\pic[rotate=-30] at (0,.1) {trash can lid};
},
}
% \end{macrocode}
%
% Now we can use that to generate some useful icons.
%
% \begin{macrocode}
\tikzset{
eliminate icon/.pic={
\pic{trash can open};
\draw[trash can line,color=red!50!black]
(-.5,.2) to[looseness=1.5] (-.1,.23);
},
restore icon/.pic={
\pic{trash can open};
\draw[trash can line,<-,color=green!50!black]
(-.5,.2) to[looseness=1.5] (-.1,.23);
},
pool icon/.pic={
\pic{trash can};
},
}
% \end{macrocode}
%
% These icons does not use the trash can picture.
%
% \begin{macrocode}
\tikzset{
flip icon/.pic={
\draw[scale line widths,scale rounded corners,
line width=1mm,->,color=blue!50!black]
(-.5,-.5) arc(180:0:.5);% (.5,-.5);
},
pics/oob icon/.style n args={2}{code={%
\begin{scope}[box/.style args={##1,##2,##3,##4}{
minimum width=##1cm,
minimum height=##2cm,
fill=##3,
anchor=##4,
draw=gray!50!black,
scale line widths,
line width=.5pt,
transform shape},
under/.style={
below=.05cm of ##1}
]
\node[box={.5,.2,#1,north west,fill=#1}] (r1) at (.05,.45) {};
\node[under=r1.south west,box={.3,.25,#1,north west}] (r2) {};
\node[under=r2.south west,box={.2,.3, #1,north west}] (r3) {};
\node[box={.2,.4,#2,north east}] (l1) at (-.05,.45) {};
\end{scope}
}
}
}
% \end{macrocode}
%
% \iffalse
% --------------------------------------------------------------------
% </utils>
% \fi
|