diff options
author | Walter Bender <walter.bender@gmail.com> | 2012-08-09 16:41:04 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2012-08-09 16:41:04 (GMT) |
commit | 5bf60a912f375f525068821f4ef30721fd8916fd (patch) | |
tree | 79b1df87c05d889fea15e83a25c2c0efc802564d | |
parent | bf6bf560e2463ffe88da59c433893fad6d4c2a82 (diff) |
add labels for rank and file
-rw-r--r-- | chess.py | 14 | ||||
-rw-r--r-- | images/file.svg | 94 | ||||
-rw-r--r-- | images/rank.svg | 98 |
3 files changed, 206 insertions, 0 deletions
@@ -1702,6 +1702,7 @@ class Gnuchess(): self.black[4].set_layer(MID) def _generate_sprites(self, colors): + if 'xo' in self._activity.hardware: fontsize = 24 else: @@ -1719,6 +1720,19 @@ class Gnuchess(): self.bg[1].move_relative((int(self._width / 3), 0)) self.bg[2].move_relative((int(2 * self._width / 3), 0)) + xo = self._width - 8 * self.scale + xo = int(xo / 2) + yo = int(self.scale / 2) + + self.rank = Sprite(self._sprites, xo - self.scale, yo, + gtk.gdk.pixbuf_new_from_file_at_size( + '%s/images/rank.svg' % (self._bundle_path), + self.scale, 8 * self.scale)) + self.file = Sprite(self._sprites, xo, yo + int(self.scale * 8), + gtk.gdk.pixbuf_new_from_file_at_size( + '%s/images/file.svg' % (self._bundle_path), + 8 * self.scale, self.scale)) + w = h = self.scale self._squares.append(self._box(w, h, color='black')) self._squares.append(self._box(w, h, color='white')) diff --git a/images/file.svg b/images/file.svg new file mode 100644 index 0000000..ae1cf91 --- /dev/null +++ b/images/file.svg @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.2" + width="440" + height="55" + id="svg2"> + <g + transform="translate(-175,-684.69824)" + id="layer1"> + <g + transform="translate(-1.0559082,0)" + id="g3042"> + <text + x="192.3125" + y="709.5542" + id="text2985" + xml:space="preserve" + style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"><tspan + x="192.3125" + y="709.5542" + id="tspan2987">A</tspan></text> + <text + x="248.01625" + y="709.5542" + id="text2985-4" + xml:space="preserve" + style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"><tspan + x="248.01625" + y="709.5542" + id="tspan2987-8">B</tspan></text> + <text + x="304.23563" + y="709.54248" + id="text3018" + xml:space="preserve" + style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"><tspan + x="304.23563" + y="709.54248" + id="tspan3020">C</tspan></text> + <text + x="358.99017" + y="709.5542" + id="text3022" + xml:space="preserve" + style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"><tspan + x="358.99017" + y="709.5542" + id="tspan3024">D</tspan></text> + <text + x="416.76813" + y="709.5542" + id="text3026" + xml:space="preserve" + style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"><tspan + x="416.76813" + y="709.5542" + id="tspan3028">E</tspan></text> + <text + x="473.43869" + y="709.5542" + id="text3030" + xml:space="preserve" + style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"><tspan + x="473.43869" + y="709.5542" + id="tspan3032">F</tspan></text> + <text + x="527.89441" + y="709.54248" + id="text3034" + xml:space="preserve" + style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"><tspan + x="527.89441" + y="709.54248" + id="tspan3036">G</tspan></text> + <text + x="583.92041" + y="709.5542" + id="text3038" + xml:space="preserve" + style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"><tspan + x="583.92041" + y="709.5542" + id="tspan3040">H</tspan></text> + </g> + </g> +</svg> diff --git a/images/rank.svg b/images/rank.svg new file mode 100644 index 0000000..534b955 --- /dev/null +++ b/images/rank.svg @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.2" + width="55" + height="440" + id="svg2"> + <g + transform="translate(-355.53516,-610.62201)" + id="layer1"> + <text + x="387.1543" + y="644.69836" + id="text3079" + xml:space="preserve" + style="font-size:11px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan + x="387.1543" + y="644.69836" + id="tspan3095" + style="font-size:24px">8</tspan></text> + <text + x="387.6875" + y="700.37408" + id="text3079-2" + xml:space="preserve" + style="font-size:11px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan + x="387.6875" + y="700.37408" + id="tspan3095-5" + style="font-size:24px">7</tspan></text> + <text + x="387.41211" + y="756.02637" + id="text3079-3" + xml:space="preserve" + style="font-size:11px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan + x="387.41211" + y="756.02637" + id="tspan3095-4" + style="font-size:24px">6</tspan></text> + <text + x="387.45312" + y="811.53217" + id="text3079-9" + xml:space="preserve" + style="font-size:11px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan + x="387.45312" + y="811.53217" + id="tspan3095-8" + style="font-size:24px">5</tspan></text> + <text + x="387.48828" + y="867.36615" + id="text3079-33" + xml:space="preserve" + style="font-size:11px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan + x="387.48828" + y="867.36615" + id="tspan3095-0" + style="font-size:24px">4</tspan></text> + <text + x="387.2832" + y="923.01843" + id="text3079-8" + xml:space="preserve" + style="font-size:11px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan + x="387.2832" + y="923.01843" + id="tspan3095-55" + style="font-size:24px">3</tspan></text> + <text + x="387.40625" + y="978.85236" + id="text3079-1" + xml:space="preserve" + style="font-size:11px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan + x="387.40625" + y="978.85236" + id="tspan3095-1" + style="font-size:24px">2</tspan></text> + <text + x="387.37109" + y="1034.3582" + id="text3079-7" + xml:space="preserve" + style="font-size:11px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan + x="387.37109" + y="1034.3582" + id="tspan3095-88" + style="font-size:24px">1</tspan></text> + </g> +</svg> |