Debian Codegraph @

texmf-dist/doc/latex/pgf-go/en/pgfgo-definitions.tex

raw
1 \section{Definitions of Stones and Boards}
2
3
4 \subsection{Stones and Players}
5 \subsubsection{pgfgo}
6
7 \begin{center}
8 \pgfgouseprofile{pgfgo}
9 \begin{goban}[10x2, label = {at = {all}}, scale = 2]
10 \stone{A1}
11 \moves[b]{A:D2}
12 \stone[w, mark = {triangle}]{D1}
13 \moves*[b]{G1--J1|-G2}
14 \mark[b, t-circle]{E1}
15 \mark[w, t-square]{E2}
16 \end{goban}
17 \end{center}
18
19
20 We declare all players and start by defining the appearance of the neutral one.
21
22 \begin{codeexample}[code only]
23 \pgfgodefineplayer{pgfgo-neutral}{
24 stone = {
25 radius = 0.19cm,
26 line = {
27 true,
28 color = black,
29 width = 0.3pt,
30 opacity = 1,
31 },
32 fill = {
33 true,
34 color = gray,
35 opacity = 1,
36 },
37 radius = 0.17cm,
38 scale = 1,
39 drop shadow = {true, opacity = 0.5, offset = 1pt, angle = -45},
40 drop shine = {true, angle = 45}
41 },
42 move = {
43 label = {
44 color = black,
45 format = arabic,
46 }
47 },
48 mark = {
49 line = {
50 color = black,
51 width = 1pt,
52 },
53 fill = {false},
54 label = {
55 color = black,
56 format = arabic
57 }
58 }
59 }
60 \end{codeexample}
61
62
63 Some properties such as line thickness, opacity, and others should be preserved for all stones, so we copy the neutral player template.
64
65 \begin{codeexample}[code only]
66 \pgfgodefineplayer[from = pgfgo-neutral]{pgfgo-white}{
67 stone = {
68 fill = {
69 color = wainwhite
70 }
71 },
72 move = {
73 label = {
74 color = black
75 }
76 },
77 mark = {
78 line = {color = black},
79 fill = {color = white},
80 label = {color = black}
81 }
82 }
83
84
85 \pgfgodefineplayer[from = pgfgo-neutral]{pgfgo-black}{
86 stone = {
87 fill = {
88 color = wainblack
89 }
90 },
91 move = {
92 label = {
93 color = pgfgo
94 }
95 },
96 mark = {
97 line = {
98 color = pgfgo,
99 },
100 label = {color = black}
101 }
102 }
103 \end{codeexample}
104
105 \subsubsection{pgfgosmooth}
106 \begin{center}
107 \pgfgouseprofile{pgfgosmooth}
108 \begin{goban}[10x2, label = {at = {all}}, scale = 2]
109 \stone{A1}
110 \moves[b]{A:D2}
111 \stone[w, mark = {triangle}]{D1}
112 \moves*[b]{G1--J1|-G2}
113 \mark[b, t-circle]{E1}
114 \mark[w, t-square]{E2}
115 \end{goban}
116 \end{center}
117
118 \begin{codeexample}[code only]
119 \pgfgodefineplayer[from = pgfgo-neutral]{pgfgosmooth-neutral}{
120 stone = {
121 line = false,
122 radius = 0.19cm,
123 drop shine = {opacity = 0.5}}
124 }
125 \end{codeexample}
126
127 \subsection{Boards}
128 \subsubsection{pgfgo}
129 \begin{center}
130 \pgfgouseprofile{pgfgo}
131 \begin{goban}[10x2, label = {at = all}, scale = 2]
132 \end{goban}
133 \end{center}
134
135 \begin{codeexample}[code only]
136 \pgfgodefinegoban{pgfgo}{
137 background = {
138 fill = {
139 color = pgfgo,
140 opacity = 1},
141 line = {
142 color = pgfgo!10!black,
143 opacity = 1},
144 drop shadow},
145 grid = {
146 line = {
147 color = pgfgo!10!black,
148 width = 1pt}},
149 label = {
150 text color = black
151 }
152 }
153 \end{codeexample}
154