Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/card.py
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2010-02-24 16:59:41 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2010-02-24 16:59:41 (GMT)
commitaf891b8342d29a6f52ad7527862a607ae277c855 (patch)
tree42ec21b9f869390c8cb674f0ae133ac56f922ce4 /card.py
parent0741bf5614e511aba4cddf320bf7c3906dc528e8 (diff)
added match highight
Diffstat (limited to 'card.py')
-rw-r--r--card.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/card.py b/card.py
index 655c75c..31533be 100644
--- a/card.py
+++ b/card.py
@@ -18,6 +18,9 @@ import os.path
from sprites import Sprite
+def load_image(file, w, h):
+ return gtk.gdk.pixbuf_new_from_file_at_size(file, int(w), int(h))
+
#
# class for defining individual cards
#
@@ -33,20 +36,16 @@ class Card:
self.west = c[3]
self.orientation = 0
self.images = []
- self.images.append(self.load_image(tw.path,i,tw.card_dim*tw.scale))
+ file = "%s/card%d.svg" % (tw.path,i)
+ self.images.append(load_image(file, tw.card_dim*tw.scale,
+ tw.card_dim*tw.scale))
for j in range(3):
self.images.append(self.images[j].rotate_simple(90))
# create sprite from svg file
- self.spr = Sprite(tw.sprites, x, y,self.images[0])
+ self.spr = Sprite(tw.sprites, x, y, self.images[0])
self.spr.set_label(i)
self.spr.draw()
- def load_image(self, file, i, wh):
- return gtk.gdk.pixbuf_new_from_file_at_size(os.path.join(file + \
- str(i) + "x" + \
- '.svg'), \
- int(wh), int(wh))
-
def reset_image(self, tw, i):
while self.orientation != 0:
self.rotate_ccw()