Started work on website
[progcomp2013.git] / qchess / tools / image_builder.py
1 #!/usr/bin/python
2
3 import sys
4 from images import *
5
6 def main(argv):
7         pygame.init()
8         try:
9                 target = str(argv[1])
10         except:
11                 target = os.path.join(os.path.curdir, "..","data","images")
12
13         try:
14                 grid_size = int(argv[2])
15         except:
16                 grid_size = 64
17                 
18
19         if not os.path.exists(target):
20                 os.mkdir(target)
21
22         create_images([grid_size, grid_size], font_name=os.path.join(os.path.curdir, "..", "data", "DejaVuSans.ttf"))
23
24         for colour in piece_char.keys():
25                 for piece in piece_char[colour].keys():
26                         pygame.image.save(images[colour][piece], os.path.join(target,str(colour)+"_"+str(piece)+".png"))
27                         pygame.image.save(small_images[colour][piece], os.path.join(target,str(colour)+"_"+str(piece)+"_small.png"))
28
29         pygame.quit()
30         return 0
31
32 if __name__ == "__main__":
33         sys.exit(main(sys.argv))

UCC git Repository :: git.ucc.asn.au