comparison gamelib/gui_base.py @ 69:626b1eaec13c

fucking pep8
author Rizmari Versfeld <rizziepit@gmail.com>
date Tue, 08 May 2012 23:08:51 +0200
parents 7309392d9ca9
children 442a1bf9b14e
comparison
equal deleted inserted replaced
68:7309392d9ca9 69:626b1eaec13c
164 self._draw_text() 164 self._draw_text()
165 165
166 def _draw_text(self): 166 def _draw_text(self):
167 self.font.set_bold(True) 167 self.font.set_bold(True)
168 self.text_surface = self.font.render(self.text, True, (0, 0, 0)) 168 self.text_surface = self.font.render(self.text, True, (0, 0, 0))
169 size = self.font.size(self.text) 169 size = self.font.size(self.text)
170 if self.shadow: 170 if self.shadow:
171 shadow = self.font.render(self.text, True, (128, 128, 128)) 171 s = self.font.render(self.text, True, (128, 128, 128))
172 temp_surface = Surface((shadow.get_width() + 2, shadow.get_width() + 2), pygame.SRCALPHA) 172 temp_surface = Surface((s.get_width() + 2, s.get_width() + 2), pygame.SRCALPHA)
173 temp_surface.fill((255, 255, 255, 0)) 173 temp_surface.fill((255, 255, 255, 0))
174 temp_surface.blit(shadow, (2, 2)) 174 temp_surface.blit(s, (2, 2))
175 temp_surface.blit(self.text_surface, (0, 0)) 175 temp_surface.blit(self.text_surface, (0, 0))
176 self.text_surface = temp_surface 176 self.text_surface = temp_surface
177 size = [s + 2 for s in size] 177 size = [s + 2 for s in size]
178 self.text_offset = ((self.rect[2] - size[0]) / 2, 178 self.text_offset = ((self.rect[2] - size[0]) / 2,
179 (self.rect[3] - size[1]) / 2) 179 (self.rect[3] - size[1]) / 2)