2 # -*- coding: utf-8 -*-
4 #Copyright 2008-2011 Carl Gherardi
5 #This program is free software: you can redistribute it and/or modify
6 #it under the terms of the GNU Affero General Public License as published by
7 #the Free Software Foundation, version 3 of the License.
9 #This program is distributed in the hope that it will be useful,
10 #but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 #GNU General Public License for more details.
14 #You should have received a copy of the GNU Affero General Public License
15 #along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #In the "official" distribution you can find the license in agpl-3.0.txt.
20 from pygame
.locals import *
21 from pygame
.compat
import geterror
23 main_dir
= os
.path
.split(os
.path
.abspath(__file__
))[0]
24 data_dir
= os
.path
.join(main_dir
, '.')
26 def load_image(name
, colorkey
=None):
27 fullname
= os
.path
.join(data_dir
, name
)
29 image
= pygame
.image
.load(fullname
)
31 print ('Cannot load image:', fullname
)
32 print "data_dir: '%s' name: '%s'" %( data_dir
, name
)
33 raise SystemExit(str(geterror()))
34 image
= image
.convert()
35 if colorkey
is not None:
37 colorkey
= image
.get_at((0,0))
38 image
.set_colorkey(colorkey
, RLEACCEL
)
39 return image
, image
.get_rect()
43 #Initialize Everything
45 clock
= pygame
.time
.Clock()
46 screen
= pygame
.display
.set_mode((640, 480))
47 table_string
= "Tournament 2010090009 Table %s - Blinds $600/$1200 Anto $150"
49 table_title
= "Nongoma V - $200/$400 USD - Limit Holdem"
50 pygame
.display
.set_caption(table_title
)
51 pygame
.mouse
.set_visible(0)
53 # Load background image
54 bgimage
, rect
= load_image('../gfx/Table.png')
55 background
= pygame
.Surface(screen
.get_size())
56 background
.blit(bgimage
, (0, 0))
58 #Put Text On The Background, Centered
60 font
= pygame
.font
.Font(None, 24)
61 text
= font
.render("FPDB Replayer Table", 1, (10, 10, 10))
62 textpos
= text
.get_rect(centerx
=background
.get_width()/2)
63 background
.blit(text
, textpos
)
65 #Display The Background
66 screen
.blit(background
, (0, 0))
73 screen
.blit(background
, (0, 0))
76 #table_title = "Tournament 2010090009 Table %s - Blinds $600/$1200 Anto $150" % table_no
77 #pygame.display.set_caption(table_title)
81 if __name__
== '__main__':