Debian Codegraph @

texmf-dist/source/latex/wargame/chit/modifiers.dtx

raw
1 % \iffalse
2 % --------------------------------------------------------------------
3 % <*chit>
4 % \fi
5 % \subsubsection{Modifications to chits}
6 %
7 % These defines overlays one can add on top of chits, for example to
8 % shade a chit, put a semi-transparent red cover to indicate
9 % elimination, and similar.
10 %
11 % \begin{macrocode}
12 \tikzset{
13 pics/chit/shade/.style={
14 code={%
15 \path[fill=white,opacity=#1,pic actions] (-.6,-.6) rectangle(.6,.6);}},
16 pics/chit/eliminate/.style={
17 code={%
18 \path[fill=red,opacity=#1,pic actions] (-.6,-.6) rectangle(.6,.6);}},
19 pics/chit/shade/.default=0.5,
20 pics/chit/eliminate/.default=0.25,
21 dummy chit/.style={draw=none,fill=none,chit={}},
22 }
23 \def\shadechit{%
24 \@ifnextchar[{\sh@dechit}{\sh@dechit[.5]}%]
25 }
26 \def\eliminatechit{%
27 \@ifnextchar[{\elimin@techit}{\elimin@techit[.25]}%]
28 }
29 \def\sh@dechit[#1](#2){%
30 % \message{^^JShading chit with opacity `#1'}%
31 \pic[transform shape] at (#2) {chit/shade=#1};%
32 \@ifnextchar;{\@gobble}{}}
33 \def\elimin@techit[#1](#2){%
34 \pic[transform shape] at (#2) {chit/eliminate=#1};%
35 \@ifnextchar;{\@gobble}{}}
36 % \end{macrocode}
37 %
38 %
39 % \iffalse
40 % --------------------------------------------------------------------
41 % </chit>
42 % \fi