Debian Codegraph @

texmf-dist/source/latex/wargame/util/icons.dtx

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