a161556dc0882eeced2cfa7a87f6b297507dfeae
2 from pygame
.locals import *
4 pygame
.display
.set_mode((80,80),32)
8 img
= pygame
.image
.load(fname
)
9 w
,h
= img
.get_width()/2,img
.get_height()/2
11 out
= pygame
.Surface((w
*3,h
*3),SWSURFACE|SRCALPHA
,32)
13 out
.blit(img
.subsurface(0,0,w
,h
),(0,0))
14 out
.blit(img
.subsurface(w
,0,w
,h
),(w
*2,0))
15 out
.blit(img
.subsurface(0,h
,w
,h
),(0,h
*2))
16 out
.blit(img
.subsurface(w
,h
,w
,h
),(w
*2,h
*2))
18 img
= out
.subsurface((w
-1,0,1,h
*3)).convert_alpha()
21 img
= out
.subsurface((0,h
-1,w
*3,1)).convert_alpha()
27 ('button.normal','dot.normal',None,3,3,'789456123'),
28 ('button.hover','dot.hover',None,3,3,'789456123'),
29 ('button.down','dot.down',None,3,3,'789456123'),
31 ('checkbox.off.normal','box.normal',None,2,2,'7913'),
32 ('checkbox.on.normal','box.down','check',2,2,'7913'),
33 ('checkbox.off.hover','box.hover',None,2,2,'7913'),
34 ('checkbox.on.hover','box.hover','check',2,2,'7913'),
36 ('radio.off.normal','dot.normal',None,2,2,'7913'),
37 ('radio.on.normal','dot.down','radio',2,2,'7913'),
38 ('radio.off.hover','dot.hover',None,2,2,'7913'),
39 ('radio.on.hover','dot.hover','radio',2,2,'7913'),
41 ('tool.normal','box.normal',None,3,3,'789456123'),
42 ('tool.hover','box.hover',None,3,3,'789456123'),
43 ('tool.down','box.down',None,3,3,'789456123'),
45 ('hslider','idot.normal',None,3,3,'789456123'),
46 ('hslider.bar.normal','dot.normal',None,3,3,'789456123'),
47 ('hslider.bar.hover','dot.hover',None,3,3,'789456123'),
48 ('hslider.left','sbox.normal','left',2,2,'7913'),
49 ('hslider.right','sbox.normal','right',2,2,'7913'),
52 ('vslider','idot.normal',None,3,3,'789456123'),
53 ('vslider.bar.normal','vdot.normal',None,3,3,'789456123'),
54 ('vslider.bar.hover','vdot.hover',None,3,3,'789456123'),
55 ('vslider.up','vsbox.normal','up',2,2,'7913'),
56 ('vslider.down','vsbox.normal','down',2,2,'7913'),
58 ('dialog.close.normal','rdot.hover',None,2,2,'7913'),
59 ('dialog.close.hover','rdot.hover','x',2,2,'7913'),
60 ('dialog.close.down','rdot.down','x',2,2,'7913'),
62 ('menu.normal','desktop',None,1,1,'7'),
63 ('menu.hover','box.normal',None,3,3,'789456123'),
64 ('menu.down','box.down',None,3,3,'789456123'),
66 ('select.selected.normal','box.normal',None,3,3,'788455122'),
67 ('select.selected.hover','box.hover',None,3,3,'788455122'),
68 ('select.selected.down','box.down',None,3,3,'788455122'),
70 ('select.arrow.normal','box.hover',None,3,3,'889556223'),
71 ('select.arrow.hover','box.hover',None,3,3,'889556223'),
72 ('select.arrow.down','box.down',None,3,3,'889556223'),
74 ('progressbar','sbox.normal',None,3,3,'789456123'),
75 ('progressbar.bar','box.hover',None,3,3,'789456123'),
78 for fname
,img
,over
,ww
,hh
,s
in todo
:
81 out
= pygame
.Surface((ww
*w
,hh
*h
),SWSURFACE|SRCALPHA
,32)
87 xx
,yy
= (c
-1)%3,2-(c
-1)/3
88 out
.blit(img
.subsurface((xx
*w
,yy
*h
,w
,h
)),(x
*w
,y
*h
))
91 over
= pygame
.image
.load(over
+".png")
93 pygame
.image
.save(out
,fname
+".tga")